diff options
author | Eric Wong <e@80x24.org> | 2019-10-06 23:30:34 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-10-07 10:20:10 +0900 |
commit | 6bcbdfb277bdc81b5ad6996b3fb005382a35c2ee (patch) | |
tree | d2c5a170735b75f905cfe0314aec1d6431e6142a /name-hash.c | |
parent | 973d5eea7455e1053842f7474c8ec34755f3525b (diff) | |
download | git-6bcbdfb277bdc81b5ad6996b3fb005382a35c2ee.tar.gz |
hashmap_get_next returns "struct hashmap_entry *"
This is a step towards removing the requirement for
hashmap_entry being the first field of a struct.
Signed-off-by: Eric Wong <e@80x24.org>
Reviewed-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'name-hash.c')
-rw-r--r-- | name-hash.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/name-hash.c b/name-hash.c index 44d788f1ce..dbacb34f50 100644 --- a/name-hash.c +++ b/name-hash.c @@ -702,15 +702,17 @@ void adjust_dirname_case(struct index_state *istate, char *name) struct cache_entry *index_file_exists(struct index_state *istate, const char *name, int namelen, int icase) { struct cache_entry *ce; + struct hashmap_entry *ent; lazy_init_name_hash(istate); - ce = hashmap_get_from_hash(&istate->name_hash, + ent = hashmap_get_from_hash(&istate->name_hash, memihash(name, namelen), NULL); - while (ce) { + while (ent) { + ce = container_of(ent, struct cache_entry, ent); if (same_name(ce, name, namelen, icase)) return ce; - ce = hashmap_get_next(&istate->name_hash, &ce->ent); + ent = hashmap_get_next(&istate->name_hash, ent); } return NULL; } |