Skip to content

Commit 09ddaf2

Browse files
committed
hashmap: introduce ordered_hashmap_free_and_replace()
1 parent 919aeb6 commit 09ddaf2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/basic/hashmap.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ OrderedHashmap* _ordered_hashmap_new(const struct hash_ops *hash_ops HASHMAP_DE
8888
#define hashmap_new(ops) _hashmap_new(ops HASHMAP_DEBUG_SRC_ARGS)
8989
#define ordered_hashmap_new(ops) _ordered_hashmap_new(ops HASHMAP_DEBUG_SRC_ARGS)
9090

91-
#define hashmap_free_and_replace(a, b) \
91+
#define hashmap_free_and_replace(a, b) \
9292
free_and_replace_full(a, b, hashmap_free)
93+
#define ordered_hashmap_free_and_replace(a, b) \
94+
free_and_replace_full(a, b, ordered_hashmap_free)
9395

9496
HashmapBase* _hashmap_free(HashmapBase *h, free_func_t default_free_key, free_func_t default_free_value);
9597
static inline Hashmap* hashmap_free(Hashmap *h) {

0 commit comments

Comments
 (0)