From a4c1e63637eec7c2ee10475093a9dba110526eba Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Sun, 6 Jan 2013 05:17:30 +0000 Subject: [PATCH] Less pointer dereferences --- correct.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/correct.c b/correct.c index cd2ab2d..c91cf60 100644 --- a/correct.c +++ b/correct.c @@ -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; } -- 2.39.2