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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user