@@ -460,7 +460,7 @@ public function shuffle()
460
460
{
461
461
return $ this ->newLazyCollection (function () {
462
462
$ xs = $ this ->getSource ();
463
- $ array = Iterators::toArray ($ xs );
463
+ $ array = Iterators::toList ($ xs );
464
464
shuffle ($ array );
465
465
return $ array ;
466
466
});
@@ -470,7 +470,7 @@ public function sample($n = null)
470
470
{
471
471
$ xs = $ this ->getSource ();
472
472
if ($ n === null ) {
473
- $ array = Iterators::toArray ($ xs );
473
+ $ array = Iterators::toList ($ xs );
474
474
if (empty ($ array )) {
475
475
return null ;
476
476
}
@@ -646,15 +646,15 @@ public function reverse()
646
646
{
647
647
return $ this ->newLazyCollection (function () {
648
648
$ xs = $ this ->getSource ();
649
- return array_reverse (Iterators::toArray ($ xs ));
649
+ return array_reverse (Iterators::toList ($ xs ));
650
650
});
651
651
}
652
652
653
653
public function sort ($ comparer = null )
654
654
{
655
655
$ comparer = $ this ->resolveComparer ($ comparer );
656
656
return $ this ->newLazyCollection (function () use ($ comparer ) {
657
- $ xs = Iterators::toArray ($ this ->getSource ());
657
+ $ xs = Iterators::toList ($ this ->getSource ());
658
658
usort ($ xs , $ comparer );
659
659
return $ xs ;
660
660
});
@@ -693,7 +693,7 @@ public function object($values = null)
693
693
694
694
public function indexOf ($ value , $ isSorted = 0 )
695
695
{
696
- $ xs = Iterators::toArray ($ this ->getSource ());
696
+ $ xs = Iterators::toList ($ this ->getSource ());
697
697
698
698
if ($ isSorted === true ) {
699
699
$ i = $ this ->newCollection ($ xs )->sortedIndex ($ value );
@@ -713,7 +713,7 @@ public function indexOf($value, $isSorted = 0)
713
713
714
714
public function lastIndexOf ($ x , $ fromIndex = null )
715
715
{
716
- $ xs = Iterators::toArray ($ this ->getSource ());
716
+ $ xs = Iterators::toList ($ this ->getSource ());
717
717
$ l = count ($ xs );
718
718
$ i = $ fromIndex !== null ? min ($ l , $ fromIndex ) : $ l ;
719
719
@@ -728,7 +728,7 @@ public function lastIndexOf($x, $fromIndex = null)
728
728
729
729
public function sortedIndex ($ value , $ selector = null )
730
730
{
731
- $ xs = Iterators::toArray ($ this ->getSource ());
731
+ $ xs = Iterators::toList ($ this ->getSource ());
732
732
$ selector = $ this ->resolveSelector ($ selector );
733
733
$ value = $ selector ($ value , null , []);
734
734
0 commit comments