From 728b04bbb5667291f1e56058240fcd7e03cbfe74 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Wed, 26 Aug 2020 10:15:00 +1000 Subject: Merge branch 'ci-hwloc-job' of https://github.com/bertwesarg/htop into bertwesarg-ci-hwloc-job --- Vector.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Vector.c') diff --git a/Vector.c b/Vector.c index 819d9863..b5e77446 100644 --- a/Vector.c +++ b/Vector.c @@ -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]; +} -- cgit v1.2.3