util/idalloc: reserving an ID that already exists should be no-op

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11493>
This commit is contained in:
Marek Olšák
2021-05-17 15:43:54 -04:00
committed by Marge Bot
parent 6ede24cf31
commit 02f37cb9da

View File

@@ -99,7 +99,6 @@ util_idalloc_reserve(struct util_idalloc *buf, unsigned id)
{
if (id / 32 >= buf->num_elements)
util_idalloc_resize(buf, (id / 32 + 1) * 2);
assert((buf->data[id / 32] & (1u << (id % 32))) == 0);
buf->data[id / 32] |= 1u << (id % 32);
}