Skip to content

Commit

Permalink
Merge pull request #1601 from whitecolor/patch-2
Browse files Browse the repository at this point in the history
allow comporator fn return any negative value
  • Loading branch information
daffl committed Apr 21, 2015
2 parents a2f61eb + 461174a commit c7c9e6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions list/sort/sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ steal('can/util', 'can/list', function () {
b = this._getComparatorValue(this.attr(iMin), comparator);

// [1, 2, 3, 4(b), 9, 6, 3(a)]
if (comparatorFn.call(this, a, b) === -1) {
if (comparatorFn.call(this, a, b) < 0) {
isSorted = false;
iMin = i;
}
Expand All @@ -222,7 +222,7 @@ steal('can/util', 'can/list', function () {
// that are improperly sorted.
// Note: This is not part of the original selection
// sort agortithm
if (c && comparatorFn.call(this, a, c) === -1) {
if (c && comparatorFn.call(this, a, c) < 0) {
isSorted = false;
}

Expand Down

0 comments on commit c7c9e6f

Please sign in to comment.