HBASE-20928 Rewrite calculation of midpoint - addemdum

Signed-off-by: tedyu <yuzhihong@gmail.com>
This commit is contained in:
Xu Cang 2018-07-24 11:37:21 -07:00 committed by tedyu
parent ba5d1c1f28
commit 1913164970
1 changed files with 1 additions and 1 deletions

View File

@ -2068,7 +2068,7 @@ public class Bytes implements Comparable<Bytes> {
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);