From: Michal Schmidt Date: Tue, 16 Jun 2015 13:46:40 +0000 (+0200) Subject: hashmap: allow NULL key in ordered_hashmap_next() X-Git-Tag: v226.4~1^2~280 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=b0c8498704d91b644ee3203177b0f602ab13826e hashmap: allow NULL key in ordered_hashmap_next() There is no reason to require key to be non-NULL. Change test_ordered_hashmap_next() to use trivial_hash_ops in order to test NULL key too. --- diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c index 0ee2f3bd3..e5f05f36f 100644 --- a/src/shared/hashmap.c +++ b/src/shared/hashmap.c @@ -1798,8 +1798,6 @@ void *ordered_hashmap_next(OrderedHashmap *h, const void *key) { struct ordered_hashmap_entry *e; unsigned hash, idx; - assert(key); - if (!h) return NULL;