mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-21 10:51:10 +00:00
Less pointer dereferences
This commit is contained in:
parent
cc7e1a3363
commit
a4c1e63637
1 changed files with 4 additions and 3 deletions
|
@ -457,12 +457,13 @@ static int correct_exist(char **array, size_t rows, char *ident) {
|
|||
static GMQCC_INLINE char **correct_known_resize(char **res, size_t *allocated, size_t size) {
|
||||
size_t oldallocated = *allocated;
|
||||
char **out;
|
||||
if (size+1 < *allocated)
|
||||
if (size+1 < oldallocated)
|
||||
return res;
|
||||
|
||||
*allocated += 32;
|
||||
out = correct_pool_alloc(sizeof(*res) * *allocated);
|
||||
out = correct_pool_alloc(sizeof(*res) * oldallocated + 32);
|
||||
memcpy(out, res, sizeof(*res) * oldallocated);
|
||||
|
||||
*allocated += 32;
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue