From: Yu Watanabe Date: Sun, 6 Feb 2022 20:34:37 +0000 (+0900) Subject: ordered-set: introduce ordered_set_clear() X-Git-Tag: v251-rc1~291^2~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=885ea2ab1cd7dc2d73314a5db4f3ac0d886ebf36;p=thirdparty%2Fsystemd.git ordered-set: introduce ordered_set_clear() --- diff --git a/src/basic/ordered-set.h b/src/basic/ordered-set.h index 3ee47350b33..c0650e0158c 100644 --- a/src/basic/ordered-set.h +++ b/src/basic/ordered-set.h @@ -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); }