cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject cassandra git commit: ninja fix argument order to asymmetric comparator in TreeCursor
Date Thu, 30 Jul 2015 08:18:26 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 88e534a4f -> b44a773b9


ninja fix argument order to asymmetric comparator in TreeCursor


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/b44a773b
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/b44a773b
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/b44a773b

Branch: refs/heads/trunk
Commit: b44a773b916074d345348923eac0f5c6274b69ca
Parents: 88e534a
Author: Benedict Elliott Smith <benedict@apache.org>
Authored: Thu Jul 30 09:17:53 2015 +0100
Committer: Benedict Elliott Smith <benedict@apache.org>
Committed: Thu Jul 30 09:18:14 2015 +0100

----------------------------------------------------------------------
 src/java/org/apache/cassandra/utils/btree/TreeCursor.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b44a773b/src/java/org/apache/cassandra/utils/btree/TreeCursor.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/btree/TreeCursor.java b/src/java/org/apache/cassandra/utils/btree/TreeCursor.java
index 8523810..164b83f 100644
--- a/src/java/org/apache/cassandra/utils/btree/TreeCursor.java
+++ b/src/java/org/apache/cassandra/utils/btree/TreeCursor.java
@@ -141,8 +141,8 @@ class TreeCursor<K> extends NodeCursor<K>
             if (bound == null)
                 break; // we're all that's left
 
-            int cmpbound = comparator.compare(key, bound.bound(forwards));
-            if (forwards ? cmpbound < 0 : cmpbound > 0)
+            int cmpbound = comparator.compare(bound.bound(forwards), key); // order of provision
matters for asymmetric comparators
+            if (forwards ? cmpbound > 0 : cmpbound < 0)
                 break; //  already in correct sub-tree
 
             // bound is on-or-before target, so ascend to that bound and continue looking
upwards


Mime
View raw message