Skip to content

Commit

Permalink
Fix invalid range in UnsafeSorter.
Browse files Browse the repository at this point in the history
TODO: write fuzz tests to uncover stuff like this.
Sorting has nice invariants; should be an easy test
to write.
  • Loading branch information
JoshRosen committed May 1, 2015
1 parent e900152 commit 767d3ca
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void insertRecord(long objectAddress) {
}

public Iterator<KeyPointerAndPrefix> getSortedIterator() {
sorter.sort(sortBuffer, 0, sortBufferInsertPosition, sortComparator);
sorter.sort(sortBuffer, 0, sortBufferInsertPosition / 2, sortComparator);
return new Iterator<KeyPointerAndPrefix>() {
private int position = 0;
private final KeyPointerAndPrefix keyPointerAndPrefix = new KeyPointerAndPrefix();
Expand Down

0 comments on commit 767d3ca

Please sign in to comment.