]> git.ipfire.org Git - thirdparty/git.git/blobdiff - hashmap.c
hashmap_get takes "const struct hashmap_entry *"
[thirdparty/git.git] / hashmap.c
index 9c2db3e0c848d41fce59e8f3d5ccc4b53fe895a1..092236c09aac0155b7b317afe4d2c47e9628cf37 100644 (file)
--- a/hashmap.c
+++ b/hashmap.c
@@ -186,7 +186,8 @@ void hashmap_free(struct hashmap *map, int free_entries)
        memset(map, 0, sizeof(*map));
 }
 
-void *hashmap_get(const struct hashmap *map, const void *key, const void *keydata)
+void *hashmap_get(const struct hashmap *map, const struct hashmap_entry *key,
+               const void *keydata)
 {
        return *find_entry_ptr(map, key, keydata);
 }
@@ -296,7 +297,7 @@ const void *memintern(const void *data, size_t len)
        /* lookup interned string in pool */
        hashmap_entry_init(&key.ent, memhash(data, len));
        key.len = len;
-       e = hashmap_get(&map, &key, data);
+       e = hashmap_get(&map, &key.ent, data);
        if (!e) {
                /* not found: create it */
                FLEX_ALLOC_MEM(e, data, data, len);