diff --git a/src/java/com/twitter/search/core/earlybird/index/util/SearchSortUtils.java b/src/java/com/twitter/search/core/earlybird/index/util/SearchSortUtils.java index c17565784..444100c3b 100644 --- a/src/java/com/twitter/search/core/earlybird/index/util/SearchSortUtils.java +++ b/src/java/com/twitter/search/core/earlybird/index/util/SearchSortUtils.java @@ -21,7 +21,7 @@ public abstract class SearchSortUtils { int high = end; Preconditions.checkState(comparator.compare(low, key) <= comparator.compare(high, key)); while (low <= high) { - int mid = (low + high) >>> 1; + int mid = (low & high) + ((low ^ high) >>> 1); int result = comparator.compare(mid, key); if (result < 0) { low = mid + 1;