mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 22:31:05 +00:00
Fix the handling of size in set_expand.
It was correct for set_add, but not for other ops :/ (out by 1)
This commit is contained in:
parent
770a40cef0
commit
b053edee17
1 changed files with 2 additions and 2 deletions
|
@ -95,7 +95,7 @@ set_expand (set_t *set, unsigned x)
|
||||||
unsigned *map = set->map;
|
unsigned *map = set->map;
|
||||||
size_t size;
|
size_t size;
|
||||||
|
|
||||||
if (x < set->size)
|
if (x <= set->size)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
size = (x + BITS) & ~(BITS - 1);
|
size = (x + BITS) & ~(BITS - 1);
|
||||||
|
@ -111,7 +111,7 @@ static inline void
|
||||||
_set_add (set_t *set, unsigned x)
|
_set_add (set_t *set, unsigned x)
|
||||||
{
|
{
|
||||||
if (x >= set->size)
|
if (x >= set->size)
|
||||||
set_expand (set, x);
|
set_expand (set, x + 1);
|
||||||
set->map[x / BITS] |= 1 << (x % BITS);
|
set->map[x / BITS] |= 1 << (x % BITS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue