mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
hashmap_remove takes "const struct hashmap_entry *"
This is less error-prone than "const void *" as the compiler now detects invalid types being passed. Signed-off-by: Eric Wong <e@80x24.org> Reviewed-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
b6c5241606
commit
28ee794128
@@ -95,7 +95,7 @@ static void remove_dir_entry(struct index_state *istate, struct cache_entry *ce)
|
||||
struct dir_entry *dir = hash_dir_entry(istate, ce, ce_namelen(ce));
|
||||
while (dir && !(--dir->nr)) {
|
||||
struct dir_entry *parent = dir->parent;
|
||||
hashmap_remove(&istate->dir_hash, dir, NULL);
|
||||
hashmap_remove(&istate->dir_hash, &dir->ent, NULL);
|
||||
free(dir);
|
||||
dir = parent;
|
||||
}
|
||||
@@ -625,7 +625,7 @@ void remove_name_hash(struct index_state *istate, struct cache_entry *ce)
|
||||
if (!istate->name_hash_initialized || !(ce->ce_flags & CE_HASHED))
|
||||
return;
|
||||
ce->ce_flags &= ~CE_HASHED;
|
||||
hashmap_remove(&istate->name_hash, ce, ce);
|
||||
hashmap_remove(&istate->name_hash, &ce->ent, ce);
|
||||
|
||||
if (ignore_case)
|
||||
remove_dir_entry(istate, ce);
|
||||
|
||||
Reference in New Issue
Block a user