From cad4d92a00ec150e5a29ec8354525a28fca61cd9 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Fri, 18 Aug 2017 21:25:25 +0200 Subject: [PATCH] _set of a aarray will create only a copy which fits exactly in what is needed. No need for extra space. --- m-array.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/m-array.h b/m-array.h index c1f2db10..eb1af7d3 100644 --- a/m-array.h +++ b/m-array.h @@ -150,11 +150,7 @@ ARRAYI_CONTRACT(s); \ if (M_UNLIKELY (d == s)) return; \ if (s->size > d->alloc) { \ - size_t alloc = ARRAYI_INC_ALLOC_SIZE(oplist, s->size); \ - if (M_UNLIKELY (alloc <= d->alloc)) { \ - M_MEMORY_FULL(sizeof (type) * alloc); \ - return ; \ - } \ + const size_t alloc = s->size; \ type *ptr = M_GET_REALLOC oplist (type, d->ptr, alloc); \ if (M_UNLIKELY (ptr == NULL)) { \ M_MEMORY_FULL(sizeof (type) * alloc); \