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

Function attr_hashmap_get

attr.c:100–112  ·  view source on GitHub ↗

* Retrieve the 'value' stored in a hashmap given the provided 'key'. * If there is no matching entry, return NULL. */

Source from the content-addressed store, hash-verified

98 * If there is no matching entry, return NULL.
99 */
100static void *attr_hashmap_get(struct attr_hashmap *map,
101 const char *key, size_t keylen)
102{
103 struct attr_hash_entry k;
104 struct attr_hash_entry *e;
105
106 hashmap_entry_init(&k.ent, memhash(key, keylen));
107 k.key = key;
108 k.keylen = keylen;
109 e = hashmap_get_entry(&map->map, &k, ent, NULL);
110
111 return e ? e->value : NULL;
112}
113
114/* Add 'value' to a hashmap based on the provided 'key'. */
115static void attr_hashmap_add(struct attr_hashmap *map,

Callers 1

git_attr_internalFunction · 0.85

Calls 2

hashmap_entry_initFunction · 0.85
memhashFunction · 0.85

Tested by

no test coverage detected