]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
ordered-set: introduce ordered_set_clear()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 6 Feb 2022 20:34:37 +0000 (05:34 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 14 Feb 2022 05:58:49 +0000 (14:58 +0900)
src/basic/ordered-set.h

index 3ee47350b33cf8beb6340fe5acd639cebd747c91..c0650e0158cca366488605b682d306a61ca5766e 100644 (file)
@@ -18,6 +18,14 @@ int _ordered_set_ensure_allocated(OrderedSet **s, const struct hash_ops *ops  HA
 int _ordered_set_ensure_put(OrderedSet **s, const struct hash_ops *ops, void *p  HASHMAP_DEBUG_PARAMS);
 #define ordered_set_ensure_put(s, hash_ops, key) _ordered_set_ensure_put(s, hash_ops, key  HASHMAP_DEBUG_SRC_ARGS)
 
+static inline void ordered_set_clear(OrderedSet *s) {
+        return ordered_hashmap_clear((OrderedHashmap*) s);
+}
+
+static inline void ordered_set_clear_free(OrderedSet *s) {
+        return ordered_hashmap_clear_free((OrderedHashmap*) s);
+}
+
 static inline OrderedSet* ordered_set_free(OrderedSet *s) {
         return (OrderedSet*) ordered_hashmap_free((OrderedHashmap*) s);
 }