MCPcopy Index your code
hub / github.com/git/git / hashmap_add

Function hashmap_add

hashmap.c:232–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232void hashmap_add(struct hashmap *map, struct hashmap_entry *entry)
233{
234 unsigned int b;
235
236 if (!map->table)
237 alloc_table(map, HASHMAP_INITIAL_SIZE);
238
239 b = bucket(map, entry);
240 /* add entry */
241 entry->next = map->table[b];
242 map->table[b] = entry;
243
244 /* fix size and rehash if appropriate */
245 if (map->do_count_items) {
246 map->private_size++;
247 if (map->private_size > map->grow_at)
248 rehash(map, map->tablesize << HASHMAP_RESIZE_BITS);
249 }
250}
251
252struct hashmap_entry *hashmap_remove(struct hashmap *map,
253 const struct hashmap_entry *key,

Callers 15

configset_add_valueFunction · 0.85
populate_worktree_mapFunction · 0.85
insert_file_tableFunction · 0.85
get_fingerprintFunction · 0.85
find_exact_matchesFunction · 0.85
add_delta_base_cacheFunction · 0.85
label_oidFunction · 0.85
make_script_with_mergesFunction · 0.85
add_pattern_to_hashsetsFunction · 0.85
cache_addFunction · 0.85
hashmap_putFunction · 0.85
meminternFunction · 0.85

Calls 3

alloc_tableFunction · 0.85
bucketFunction · 0.85
rehashFunction · 0.85

Tested by 1

perf_hashmapFunction · 0.68