Index: include/core/SkTSearch.h |
diff --git a/include/core/SkTSearch.h b/include/core/SkTSearch.h |
index a4e4994ef378b2b14a39c1da2daa601c35677f71..549bcfd7c844ef7e0e51f616b634fe8833f21dbd 100644 |
--- a/include/core/SkTSearch.h |
+++ b/include/core/SkTSearch.h |
@@ -49,7 +49,7 @@ int SkTSearch(const T base[], int count, const K& key, size_t elemSize, LESS& le |
int hi = count - 1; |
while (lo < hi) { |
- int mid = (hi + lo) >> 1; |
+ int mid = lo + ((hi - lo) >> 1); |
const T* elem = (const T*)((const char*)base + mid * elemSize); |
if (less(*elem, key)) |