From 1913164970b17365e51662cf9cc9acacdda04fec Mon Sep 17 00:00:00 2001 From: Xu Cang Date: Tue, 24 Jul 2018 11:37:21 -0700 Subject: [PATCH] HBASE-20928 Rewrite calculation of midpoint - addemdum Signed-off-by: tedyu --- hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java index 12aaa67ca6..e63c0db5b2 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java @@ -2068,7 +2068,7 @@ public class Bytes implements Comparable { int high = arr.length - 1; KeyValue.KeyOnlyKeyValue r = new KeyValue.KeyOnlyKeyValue(); while (low <= high) { - int mid = (low+high) >>> 1; + int mid = low + ((high - low) >> 1); // we have to compare in this order, because the comparator order // has special logic when the 'left side' is a special key. r.setKey(arr[mid], 0, arr[mid].length); -- 2.11.4.GIT