mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-22 10:41:43 +00:00
a vector_remove shouldn't clear the vector when failing to reallocate as a smaller chunk, just return false. The value is still removed from the vector, so no unstable state is generated by this, which makes a _remove safe to ignore where it makes sense.
This commit is contained in:
parent
ce43a35307
commit
9867ce26b3
1 changed files with 1 additions and 3 deletions
4
astir.h
4
astir.h
|
@ -73,10 +73,8 @@ bool GMQCC_WARN Tself##_##mem##_remove(Tself *self, size_t idx) \
|
|||
{ \
|
||||
self->mem##_alloc /= 2; \
|
||||
reall = (Twhat*)mem_a(sizeof(Twhat) * self->mem##_count); \
|
||||
if (!reall) { \
|
||||
MEM_VECTOR_CLEAR(self, mem); \
|
||||
if (!reall) \
|
||||
return false; \
|
||||
} \
|
||||
memcpy(reall, self->mem, sizeof(Twhat) * self->mem##_count); \
|
||||
mem_d(self->mem); \
|
||||
self->mem = reall; \
|
||||
|
|
Loading…
Reference in a new issue