_set of a aarray will create only a copy which fits exactly in

what is needed. No need for extra space.
This commit is contained in:
Patrick Pelissier committed 2017-08-18 21:25:25 +02:00
1 parent 56bb67fbb1
commit cad4d92a00
1 file changed
+1 -5
+1 -5
View File
@@ -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); \