[ecs] Find correct correct sub-pool range

Returning -1 for key > value doesn't work too well for bsearch.
This commit is contained in:
Bill Currie 2023-01-22 01:04:23 +09:00
parent bc041d6291
commit 254fcff8ff

View file

@ -90,7 +90,7 @@ range_cmp (const void *_key, const void *_range, void *_subpool)
ecs_subpool_t *subpool = _subpool;
if (*key >= *range) {
return -1;
return 1;
}
if (range - subpool->ranges > 0) {
return *key >= range[-1] ? 0 : -1;