mirror of
https://github.com/typesense/typesense.git
synced 2025-05-22 23:06:30 +08:00
Use lower bound search to implement indexOf()
This commit is contained in:
parent
10ff747802
commit
884a83f53c
@ -62,7 +62,10 @@ public:
|
||||
}
|
||||
|
||||
uint32_t indexOf(uint32_t value) {
|
||||
return for_binary_search(in, length, value);
|
||||
uint32_t actual;
|
||||
uint32_t index = for_lower_bound_search(in, length, value, &actual);
|
||||
if(actual == value) return index;
|
||||
return length;
|
||||
}
|
||||
|
||||
uint32_t* uncompress() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user