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:
parent
5d3d45f0cf
commit
4d7a7694ae
|
@ -59,12 +59,9 @@
|
||||||
type_t items[], int count) \
|
type_t items[], int count) \
|
||||||
{ \
|
{ \
|
||||||
assert (pos >= 0 && len >= 0 && count >= 0); \
|
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) { \
|
if (len != count) { \
|
||||||
pfx##_array_grow(arr, arr->len + count - len); \
|
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, \
|
memmove(arr->tab + pos + count, arr->tab + pos + len, \
|
||||||
(arr->len - pos - len) * sizeof(*items)); \
|
(arr->len - pos - len) * sizeof(*items)); \
|
||||||
arr->len += count - len; \
|
arr->len += count - len; \
|
||||||
|
|
Loading…
Reference in New Issue