MCPcopy Create free account
hub / github.com/git/git / oidmap_clear_with_free

Function oidmap_clear_with_free

oidmap.c:31–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31void oidmap_clear_with_free(struct oidmap *map,
32 oidmap_free_fn free_fn)
33{
34 struct hashmap_iter iter;
35 struct hashmap_entry *e;
36
37 if (!map || !map->map.cmpfn)
38 return;
39
40 hashmap_iter_init(&map->map, &iter);
41 while ((e = hashmap_iter_next(&iter))) {
42 struct oidmap_entry *entry =
43 container_of(e, struct oidmap_entry, internal_entry);
44 if (free_fn)
45 free_fn(entry);
46 }
47
48 hashmap_clear(&map->map);
49}
50
51void *oidmap_get(const struct oidmap *map, const struct object_id *key)
52{

Callers 4

oidmap_clearFunction · 0.85
cmd_rev_listFunction · 0.85

Calls 2

hashmap_iter_initFunction · 0.85
hashmap_iter_nextFunction · 0.85