summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/db.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/db.h b/src/common/db.h
index d7d111c86..1c0955221 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -1395,6 +1395,16 @@ HPShared struct db_interface *DB;
} while(false)
/**
+ * Removes all values from the vector.
+ *
+ * Does not free the allocated data.
+ */
+#define VECTOR_TRUNCATE(_vec) \
+ do { \
+ VECTOR_LENGTH(_vec) = 0; \
+ } while (false)
+
+/**
* Clears the vector, freeing allocated data.
*
* @param _vec Vector.