summaryrefslogtreecommitdiffstats
path: root/Vector.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@redhat.com>2020-08-26 10:15:00 +1000
committerNathan Scott <nathans@redhat.com>2020-08-26 10:39:43 +1000
commit728b04bbb5667291f1e56058240fcd7e03cbfe74 (patch)
treead199ce3a3303e723eb9332aa6cb847b9530084a /Vector.c
parentd0f31ede5624ed2f35ca25043f6a28adfe3bc171 (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.c12
1 files changed, 12 insertions, 0 deletions
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];
+}

© 2014-2024 Faster IT GmbH | imprint | privacy policy