When we delete an item from a sorted array we just have to move the rest
of the items down to keep it sorted; we don't have to actually re-sort
the whole thing.
offset = svec_find(svec, name);
if (offset != SIZE_MAX) {
free(svec->names[offset]);
- svec->names[offset] = svec->names[svec->n-1];
+ memmove(&svec->names[offset], &svec->names[offset + 1],
+ sizeof *svec->names * (svec->n - offset - 1));
svec->n--;
- svec_sort(svec);
}
}