From ad6e60a8ed33eca9266024970843aeaefa40cd7f Mon Sep 17 00:00:00 2001 From: seancfoley Date: Fri, 15 May 2020 15:24:02 -0400 Subject: [PATCH] fix to reversed sub-node order for block size iterator --- .../inet.ipaddr/inet/ipaddr/format/util/BinaryTreeNode.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/util/BinaryTreeNode.java b/IPAddress/src/inet.ipaddr/inet/ipaddr/format/util/BinaryTreeNode.java index 5a722e62..1070249b 100644 --- a/IPAddress/src/inet.ipaddr/inet/ipaddr/format/util/BinaryTreeNode.java +++ b/IPAddress/src/inet.ipaddr/inet/ipaddr/format/util/BinaryTreeNode.java @@ -1378,7 +1378,7 @@ public int compare(BinaryTreeNode node1, BinaryTreeNode node2) { this.addedOnly = addedOnly; this.bounds = bounds; Comparator> comp = - (Comparator>) (reverseBlocksEqualSize ? COMP : REVERSE_COMP); + (Comparator>) (reverseBlocksEqualSize ? REVERSE_COMP : COMP); if(treeSize > 0) { int initialCapacity = treeSize >> 1; if(initialCapacity == 0) { @@ -1478,7 +1478,7 @@ static class Cached { 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> queue; private C cacheItem; @@ -1493,7 +1493,7 @@ static class Cached { ChangeTracker changeTracker) { super(start, null, changeTracker); @SuppressWarnings("unchecked") - Comparator> comp = (Comparator>) (reverseBlocksEqualSize ? COMP : REVERSE_COMP); + Comparator> comp = (Comparator>) (reverseBlocksEqualSize ? REVERSE_COMP : COMP); if(treeSize == 0) { queue = new PriorityQueue<>(comp); } else {