]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ordered-set: introduce ordered_set_reserve()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 6 May 2022 15:42:45 +0000 (00:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 7 May 2022 06:14:41 +0000 (15:14 +0900)
src/basic/ordered-set.h

index c0650e0158cca366488605b682d306a61ca5766e..e73da20573e307200caa65c5567db22cf443fab3 100644 (file)
@@ -74,6 +74,10 @@ static inline char** ordered_set_get_strv(OrderedSet *s) {
         return _hashmap_get_strv(HASHMAP_BASE((OrderedHashmap*) s));
 }
 
+static inline int ordered_set_reserve(OrderedSet *s, unsigned entries_add) {
+        return ordered_hashmap_reserve((OrderedHashmap*) s, entries_add);
+}
+
 int ordered_set_consume(OrderedSet *s, void *p);
 int _ordered_set_put_strdup(OrderedSet **s, const char *p  HASHMAP_DEBUG_PARAMS);
 #define ordered_set_put_strdup(s, p) _ordered_set_put_strdup(s, p  HASHMAP_DEBUG_SRC_ARGS)