@@ -93,12 +93,12 @@ OrderedHashmap* _ordered_hashmap_new(const struct hash_ops *hash_ops HASHMAP_DE
9393#define ordered_hashmap_free_and_replace (a , b ) \
9494 free_and_replace_full(a, b, ordered_hashmap_free)
9595
96- HashmapBase * _hashmap_free (HashmapBase * h , free_func_t default_free_key , free_func_t default_free_value );
96+ HashmapBase * _hashmap_free (HashmapBase * h );
9797static inline Hashmap * hashmap_free (Hashmap * h ) {
98- return (void * ) _hashmap_free (HASHMAP_BASE (h ), NULL , NULL );
98+ return (void * ) _hashmap_free (HASHMAP_BASE (h ));
9999}
100100static inline OrderedHashmap * ordered_hashmap_free (OrderedHashmap * h ) {
101- return (void * ) _hashmap_free (HASHMAP_BASE (h ), NULL , NULL );
101+ return (void * ) _hashmap_free (HASHMAP_BASE (h ));
102102}
103103
104104IteratedCache * iterated_cache_free (IteratedCache * cache );
@@ -266,12 +266,12 @@ static inline bool ordered_hashmap_iterate(OrderedHashmap *h, Iterator *i, void
266266 return _hashmap_iterate (HASHMAP_BASE (h ), i , value , key );
267267}
268268
269- void _hashmap_clear (HashmapBase * h , free_func_t default_free_key , free_func_t default_free_value );
269+ void _hashmap_clear (HashmapBase * h );
270270static inline void hashmap_clear (Hashmap * h ) {
271- _hashmap_clear (HASHMAP_BASE (h ), NULL , NULL );
271+ _hashmap_clear (HASHMAP_BASE (h ));
272272}
273273static inline void ordered_hashmap_clear (OrderedHashmap * h ) {
274- _hashmap_clear (HASHMAP_BASE (h ), NULL , NULL );
274+ _hashmap_clear (HASHMAP_BASE (h ));
275275}
276276
277277/*
@@ -331,27 +331,6 @@ static inline void *ordered_hashmap_first_key(OrderedHashmap *h) {
331331 return _hashmap_first_key (HASHMAP_BASE (h ), false);
332332}
333333
334- #define hashmap_clear_with_destructor (h , f ) \
335- ({ \
336- Hashmap *_h = (h); \
337- void *_item; \
338- while ((_item = hashmap_steal_first(_h))) \
339- f(_item); \
340- _h; \
341- })
342- #define hashmap_free_with_destructor (h , f ) \
343- hashmap_free(hashmap_clear_with_destructor(h, f))
344- #define ordered_hashmap_clear_with_destructor (h , f ) \
345- ({ \
346- OrderedHashmap *_h = (h); \
347- void *_item; \
348- while ((_item = ordered_hashmap_steal_first(_h))) \
349- f(_item); \
350- _h; \
351- })
352- #define ordered_hashmap_free_with_destructor (h , f ) \
353- ordered_hashmap_free(ordered_hashmap_clear_with_destructor(h, f))
354-
355334/* no hashmap_next */
356335void * ordered_hashmap_next (OrderedHashmap * h , const void * key );
357336
0 commit comments