diff --git a/include/ccapi_cpp/ccapi_util_private.h b/include/ccapi_cpp/ccapi_util_private.h index 1f7d88e2..83644d88 100644 --- a/include/ccapi_cpp/ccapi_util_private.h +++ b/include/ccapi_cpp/ccapi_util_private.h @@ -732,7 +732,7 @@ int ceilSearch(const std::vector& c, int low, int high, T x) { if (x <= c[low]) { return low; } - for (i = low; i < high; i++) { + for (i = low; i < high - 1; i++) { if (c[i] == x) { return i; }