mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-01 15:01:00 +00:00
[libr] Fix loop counter in removeObjectNoRelease
It would do 4G iterations if count was 0.
This commit is contained in:
parent
6d3fadfe6e
commit
0a63d0a0de
1 changed files with 3 additions and 3 deletions
|
@ -20,14 +20,14 @@
|
||||||
local unsigned i = count;
|
local unsigned i = count;
|
||||||
local unsigned tmp;
|
local unsigned tmp;
|
||||||
|
|
||||||
do {
|
while (i-- > 0) {
|
||||||
if (_objs[--i] == anObject) {
|
if (_objs[i] == anObject) {
|
||||||
for (tmp = i; tmp < count - 1; tmp++) {
|
for (tmp = i; tmp < count - 1; tmp++) {
|
||||||
_objs[tmp] = _objs[tmp + 1];
|
_objs[tmp] = _objs[tmp + 1];
|
||||||
}
|
}
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
} while (i);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in a new issue