Skip to content

Commit

Permalink
fix to reversed sub-node order for block size iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
seancfoley committed May 15, 2020
1 parent 99f6077 commit ad6e60a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ public int compare(BinaryTreeNode<E> node1, BinaryTreeNode<E> node2) {
this.addedOnly = addedOnly;
this.bounds = bounds;
Comparator<BinaryTreeNode<E>> comp =
(Comparator<BinaryTreeNode<E>>) (reverseBlocksEqualSize ? COMP : REVERSE_COMP);
(Comparator<BinaryTreeNode<E>>) (reverseBlocksEqualSize ? REVERSE_COMP : COMP);
if(treeSize > 0) {
int initialCapacity = treeSize >> 1;
if(initialCapacity == 0) {
Expand Down Expand Up @@ -1478,7 +1478,7 @@ static class Cached<E, C> {

private static final Comparator<?> COMP = new Comp<>(false), REVERSE_COMP = new Comp<>(true);

// heap will have either a caching objectwith the node or just the node
// heap will have the caching object with the node
private PriorityQueue<Cached<E, C>> queue;

private C cacheItem;
Expand All @@ -1493,7 +1493,7 @@ static class Cached<E, C> {
ChangeTracker changeTracker) {
super(start, null, changeTracker);
@SuppressWarnings("unchecked")
Comparator<Cached<E, C>> comp = (Comparator<Cached<E, C>>) (reverseBlocksEqualSize ? COMP : REVERSE_COMP);
Comparator<Cached<E, C>> comp = (Comparator<Cached<E, C>>) (reverseBlocksEqualSize ? REVERSE_COMP : COMP);
if(treeSize == 0) {
queue = new PriorityQueue<>(comp);
} else {
Expand Down

0 comments on commit ad6e60a

Please sign in to comment.