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

Function strset_add

strmap.c:164–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164int strset_add(struct strset *set, const char *str)
165{
166 /*
167 * Cannot use strmap_put() because it'll return NULL in both cases:
168 * - cannot find str: NULL means "not found"
169 * - does find str: NULL is the value associated with str
170 */
171 struct strmap_entry *entry = find_strmap_entry(&set->map, str);
172
173 if (entry)
174 return 0;
175
176 entry = create_entry(&set->map, str, NULL);
177 hashmap_add(&set->map.map, &entry->ent);
178 return 1;
179}

Callers 15

handle_deferred_entriesFunction · 0.85
cache_new_pairFunction · 0.85
possibly_cache_new_pairFunction · 0.85
format_tracking_infoFunction · 0.85
write_bundle_refsFunction · 0.85
clear_midx_files_extFunction · 0.85
midx_needs_updateFunction · 0.85
get_ref_informationFunction · 0.85
prepare_symlink_changesFunction · 0.85

Calls 3

find_strmap_entryFunction · 0.85
hashmap_addFunction · 0.85
create_entryFunction · 0.70

Tested by 1

read_capabilitiesFunction · 0.68