diff options
author | Nathan Scott <nathans@redhat.com> | 2020-08-26 10:15:00 +1000 |
---|---|---|
committer | Nathan Scott <nathans@redhat.com> | 2020-08-26 10:39:43 +1000 |
commit | 728b04bbb5667291f1e56058240fcd7e03cbfe74 (patch) | |
tree | ad199ce3a3303e723eb9332aa6cb847b9530084a /Vector.c | |
parent | d0f31ede5624ed2f35ca25043f6a28adfe3bc171 (diff) |
Merge branch 'ci-hwloc-job' of https://github.com/bertwesarg/htop into bertwesarg-ci-hwloc-job
Diffstat (limited to 'Vector.c')
-rw-r--r-- | Vector.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -335,3 +335,15 @@ inline int Vector_indexOf(Vector* this, void* search_, Object_Compare compare) { } return -1; } + +void Vector_splice(Vector* this, Vector* from) { + assert(Vector_isConsistent(this)); + assert(Vector_isConsistent(from)); + assert(!(this->owner && from->owner)); + + int olditmes = this->items; + this->items += from->items; + Vector_checkArraySize(this); + for (int j = 0; j < from->items; j++) + this->array[olditmes + j] = from->array[j]; +} |