]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
hashmap: introduce ordered_hashmap_free_and_replace()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 12 Apr 2025 18:17:38 +0000 (03:17 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 13 Apr 2025 01:15:02 +0000 (10:15 +0900)
src/basic/hashmap.h

index 091062b5e91d1e6b919a3f3cbcd1cf4155edd1ba..c577bd6c22a393935da110b9cc933beca80bcd91 100644 (file)
@@ -88,8 +88,10 @@ OrderedHashmap* _ordered_hashmap_new(const struct hash_ops *hash_ops  HASHMAP_DE
 #define hashmap_new(ops) _hashmap_new(ops  HASHMAP_DEBUG_SRC_ARGS)
 #define ordered_hashmap_new(ops) _ordered_hashmap_new(ops  HASHMAP_DEBUG_SRC_ARGS)
 
-#define hashmap_free_and_replace(a, b)          \
+#define hashmap_free_and_replace(a, b)                          \
         free_and_replace_full(a, b, hashmap_free)
+#define ordered_hashmap_free_and_replace(a, b)                  \
+        free_and_replace_full(a, b, ordered_hashmap_free)
 
 HashmapBase* _hashmap_free(HashmapBase *h, free_func_t default_free_key, free_func_t default_free_value);
 static inline Hashmap* hashmap_free(Hashmap *h) {