hashmap_add takes "struct hashmap_entry *"
This is less error-prone than "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
f6eb6bdcf2
commit
b94e5c1df6
@ -455,7 +455,7 @@ static int save_files_dirs(const struct object_id *oid,
|
||||
|
||||
FLEX_ALLOC_MEM(entry, path, base->buf, base->len);
|
||||
hashmap_entry_init(&entry->e, path_hash(entry->path));
|
||||
hashmap_add(&opt->current_file_dir_set, entry);
|
||||
hashmap_add(&opt->current_file_dir_set, &entry->e);
|
||||
|
||||
strbuf_setlen(base, baselen);
|
||||
return (S_ISDIR(mode) ? READ_TREE_RECURSIVE : 0);
|
||||
@ -732,7 +732,7 @@ static char *unique_path(struct merge_options *opt, const char *path, const char
|
||||
|
||||
FLEX_ALLOC_MEM(entry, path, newpath.buf, newpath.len);
|
||||
hashmap_entry_init(&entry->e, path_hash(entry->path));
|
||||
hashmap_add(&opt->current_file_dir_set, entry);
|
||||
hashmap_add(&opt->current_file_dir_set, &entry->e);
|
||||
return strbuf_detach(&newpath, NULL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user