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

Function make_trie_node

path.c:153–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151};
152
153static struct trie *make_trie_node(const char *key, void *value)
154{
155 struct trie *new_node = xcalloc(1, sizeof(*new_node));
156 new_node->len = strlen(key);
157 if (new_node->len) {
158 new_node->contents = xmalloc(new_node->len);
159 memcpy(new_node->contents, key, new_node->len);
160 }
161 new_node->value = value;
162 return new_node;
163}
164
165/*
166 * Add a key/value pair to a trie. The key is assumed to be \0-terminated.

Callers 1

add_to_trieFunction · 0.85

Calls 2

xcallocFunction · 0.85
xmallocFunction · 0.70

Tested by

no test coverage detected