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

Function attr_hashmap_add

attr.c:115–128  ·  view source on GitHub ↗

Add 'value' to a hashmap based on the provided 'key'. */

Source from the content-addressed store, hash-verified

113
114/* Add 'value' to a hashmap based on the provided 'key'. */
115static void attr_hashmap_add(struct attr_hashmap *map,
116 const char *key, size_t keylen,
117 void *value)
118{
119 struct attr_hash_entry *e;
120
121 e = xmalloc(sizeof(struct attr_hash_entry));
122 hashmap_entry_init(&e->ent, memhash(key, keylen));
123 e->key = key;
124 e->keylen = keylen;
125 e->value = value;
126
127 hashmap_add(&map->map, &e->ent);
128}
129
130struct all_attrs_item {
131 const struct git_attr *attr;

Callers 1

git_attr_internalFunction · 0.85

Calls 4

hashmap_entry_initFunction · 0.85
memhashFunction · 0.85
hashmap_addFunction · 0.85
xmallocFunction · 0.70

Tested by

no test coverage detected