diff options
Diffstat (limited to 'core/templates/search_array.h')
-rw-r--r-- | core/templates/search_array.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/templates/search_array.h b/core/templates/search_array.h index f537ef67fd..9c3f527323 100644 --- a/core/templates/search_array.h +++ b/core/templates/search_array.h @@ -38,12 +38,12 @@ class SearchArray { public: Comparator compare; - inline int bisect(const T *p_array, int p_len, const T &p_value, bool p_before) const { - int lo = 0; - int hi = p_len; + inline int64_t bisect(const T *p_array, int64_t p_len, const T &p_value, bool p_before) const { + int64_t lo = 0; + int64_t hi = p_len; if (p_before) { while (lo < hi) { - const int mid = (lo + hi) / 2; + const int64_t mid = (lo + hi) / 2; if (compare(p_array[mid], p_value)) { lo = mid + 1; } else { @@ -52,7 +52,7 @@ public: } } else { while (lo < hi) { - const int mid = (lo + hi) / 2; + const int64_t mid = (lo + hi) / 2; if (compare(p_value, p_array[mid])) { hi = mid; } else { |