chiark / gitweb /
hashmap: allow NULL key in ordered_hashmap_next()
authorMichal Schmidt <mschmidt@redhat.com>
Tue, 16 Jun 2015 13:46:40 +0000 (15:46 +0200)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:03:02 +0000 (10:03 +0100)
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.

src/shared/hashmap.c

index 0ee2f3b..e5f05f3 100644 (file)
@@ -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;