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

Function hashmap_remove

hashmap.c:252–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252struct hashmap_entry *hashmap_remove(struct hashmap *map,
253 const struct hashmap_entry *key,
254 const void *keydata)
255{
256 struct hashmap_entry *old;
257 struct hashmap_entry **e;
258
259 if (!map->table)
260 return NULL;
261 e = find_entry_ptr(map, key, keydata);
262 if (!*e)
263 return NULL;
264
265 /* remove existing entry */
266 old = *e;
267 *e = old->next;
268 old->next = NULL;
269
270 /* fix size and rehash if appropriate */
271 if (map->do_count_items) {
272 map->private_size--;
273 if (map->private_size < map->shrink_at)
274 rehash(map, map->tablesize >> HASHMAP_RESIZE_BITS);
275 }
276
277 return old;
278}
279
280struct hashmap_entry *hashmap_put(struct hashmap *map,
281 struct hashmap_entry *entry)

Callers 9

fingerprint_subtractFunction · 0.85
hashmap_putFunction · 0.85
oidmap_removeFunction · 0.85
subprocess_stopFunction · 0.85
remove_dir_entryFunction · 0.85
remove_name_hashFunction · 0.85
mark_pathFunction · 0.85

Calls 2

find_entry_ptrFunction · 0.85
rehashFunction · 0.85

Tested by

no test coverage detected