File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ Data sequences change log
33
44## ?.?.? / ????-??-??
55
6+ * Don't keep index association when sorting, this yields arrays like
7+ ` [1 => 'second', 0 => 'first'] ` . These arrays are not zero-based and
8+ considered maps e.g. by typeof()
9+ (@thekid )
10+
611## 2.1.0 / 2015-01-18
712
813* Heads up: Removed ` sum() ` operation, it can easily be rewritten to
Original file line number Diff line number Diff line change @@ -510,13 +510,13 @@ public function distinct() {
510510 public function sorted ($ comparator = null ) {
511511 $ sort = $ this ->toArray ();
512512 if ($ comparator instanceof Comparator) {
513- uasort ($ sort , Functions::$ COMPARATOR ->newInstance ([$ comparator , 'compare ' ]));
513+ usort ($ sort , Functions::$ COMPARATOR ->newInstance ([$ comparator , 'compare ' ]));
514514 } else if (is_int ($ comparator )) {
515515 array_multisort ($ sort , $ comparator );
516516 } else if ($ comparator ) {
517- uasort ($ sort , Functions::$ COMPARATOR ->newInstance ($ comparator ));
517+ usort ($ sort , Functions::$ COMPARATOR ->newInstance ($ comparator ));
518518 } else {
519- asort ($ sort );
519+ sort ($ sort );
520520 }
521521 return new self ($ sort );
522522 }
You can’t perform that action at this time.
0 commit comments