Calling destructor on splice is wrong, take doesn't want it e.g.

Also fix one assert.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
This commit is contained in:
Pierre Habouzit 2008-06-25 00:08:20 +02:00 committed by Julien Danjou
parent 5d3d45f0cf
commit 4d7a7694ae
1 changed files with 1 additions and 4 deletions

View File

@ -59,12 +59,9 @@
type_t items[], int count) \
{ \
assert (pos >= 0 && len >= 0 && count >= 0); \
assert (pos <= arr->len && pos + len < arr->len); \
assert (pos <= arr->len && pos + len <= arr->len); \
if (len != count) { \
pfx##_array_grow(arr, arr->len + count - len); \
for (int i = pos; i < pos + len; i++) { \
dtor(&arr->tab[i]); \
} \
memmove(arr->tab + pos + count, arr->tab + pos + len, \
(arr->len - pos - len) * sizeof(*items)); \
arr->len += count - len; \