mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
Fix an out-by-one error in the set operators.
I have no idea why I added that - 1.
This commit is contained in:
parent
4b64912793
commit
3c79f07705
1 changed files with 4 additions and 4 deletions
|
@ -130,7 +130,7 @@ set_union (set_t *dst, const set_t *src)
|
|||
unsigned size;
|
||||
unsigned i;
|
||||
|
||||
size = max (dst->size, src->size) - 1;
|
||||
size = max (dst->size, src->size);
|
||||
set_expand (dst, size);
|
||||
for (i = 0; i < src->size / BITS; i++)
|
||||
dst->map[i] |= src->map[i];
|
||||
|
@ -143,7 +143,7 @@ set_intersection (set_t *dst, const set_t *src)
|
|||
unsigned size;
|
||||
unsigned i;
|
||||
|
||||
size = max (dst->size, src->size) - 1;
|
||||
size = max (dst->size, src->size);
|
||||
set_expand (dst, size);
|
||||
for (i = 0; i < src->size / BITS; i++)
|
||||
dst->map[i] &= src->map[i];
|
||||
|
@ -156,7 +156,7 @@ set_difference (set_t *dst, const set_t *src)
|
|||
unsigned size;
|
||||
unsigned i;
|
||||
|
||||
size = max (dst->size, src->size) - 1;
|
||||
size = max (dst->size, src->size);
|
||||
set_expand (dst, size);
|
||||
for (i = 0; i < src->size / BITS; i++)
|
||||
dst->map[i] &= ~src->map[i];
|
||||
|
@ -169,7 +169,7 @@ set_assign (set_t *dst, const set_t *src)
|
|||
unsigned size;
|
||||
unsigned i;
|
||||
|
||||
size = max (dst->size, src->size) - 1;
|
||||
size = max (dst->size, src->size);
|
||||
set_expand (dst, size);
|
||||
for (i = 0; i < src->size / BITS; i++)
|
||||
dst->map[i] = src->map[i];
|
||||
|
|
Loading…
Reference in a new issue