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

Function insert_decoration

decorate.c:15–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15static void *insert_decoration(struct decoration *n, const struct object *base, void *decoration)
16{
17 struct decoration_entry *entries = n->entries;
18 unsigned int j = hash_obj(base, n->size);
19
20 while (entries[j].base) {
21 if (entries[j].base == base) {
22 void *old = entries[j].decoration;
23 entries[j].decoration = decoration;
24 return old;
25 }
26 if (++j >= n->size)
27 j = 0;
28 }
29 entries[j].base = base;
30 entries[j].decoration = decoration;
31 n->nr++;
32 return NULL;
33}
34
35static void grow_decoration(struct decoration *n)
36{

Callers 2

grow_decorationFunction · 0.85
add_decorationFunction · 0.85

Calls 1

hash_objFunction · 0.70

Tested by

no test coverage detected