]> git.ipfire.org Git - thirdparty/git.git/commit - patch-ids.c
patch-ids.c: use hashmap correctly
authorStefan Beller <sbeller@google.com>
Fri, 30 Jun 2017 19:14:06 +0000 (12:14 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 30 Jun 2017 20:11:54 +0000 (13:11 -0700)
commit3da492f8088413c9db2da6c489e117d4808859e9
treef7c8b8d1600efe3e16e6cd326b5b2cd43295f5a5
parent7663cdc86c860d5b5293a1dd4b0fb6c4e006d08e
patch-ids.c: use hashmap correctly

As alluded to in the previous patch, the code in patch-ids.c is
using the hashmaps API wrong.

Luckily we do not have a bug, as all hashmap functionality that we use
here (hashmap_get) passes through the keydata.  If hashmap_get_next were
to be used, a bug would occur as that passes NULL for the key_data.

So instead use the hashmap API correctly and provide the caller required
data in the compare function via the first argument that always gets
passed and was setup via the hashmap_init function.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
patch-ids.c