Skip to content

Commit e722a8a

Browse files
committed
Fix pivot selection
1 parent 18fff8a commit e722a8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Data/Traversable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ exports.traverseArrayImpl = function () {
2424
case 1: return map(array1)(f(array[bot]));
2525
case 2: return apply(map(array2)(f(array[bot])))(f(array[bot + 1]));
2626
default:
27-
var pivot = bot + Math.floor((top - bot) / 4) * 2;
27+
var pivot = Math.floor((top + bot) / 2);
2828
return apply(map(concat2)(go(bot, pivot)))(go(pivot, top));
2929
}
3030
}

0 commit comments

Comments
 (0)