From e9277d73399f84850270be8da8777bfb2ae2b58b Mon Sep 17 00:00:00 2001 From: Al Date: Sat, 25 Jul 2015 01:33:45 -0400 Subject: [PATCH] [utils] vector extend method --- src/vector.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vector.h b/src/vector.h index e8db6845..56f1e4b7 100644 --- a/src/vector.h +++ b/src/vector.h @@ -23,6 +23,11 @@ extern "C" { static inline void name##_push(name *array, type value) { \ kv_push(type, *array, value); \ } \ + static inline void name##_extend(name *array, name *other) { \ + for (int i = 0; i < other->n; i++) { \ + kv_push(type, *array, *(other->a + i)); \ + } \ + } \ static inline type name##_pop(name *array) { \ return kv_pop(*array); \ } \