MCPcopy Create free account
hub / github.com/codr7/hacktical-c / hc_set_add

Function hc_set_add

set/set.c:55–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void *hc_set_add(struct hc_set *s, const void *key, const bool force) {
56 bool ok = false;
57 const size_t i = hc_set_index(s, key, &ok);
58
59 if (ok && !force) {
60 return NULL;
61 }
62
63 return hc_vector_insert(&s->items, i, 1);
64}
65
66void hc_set_clear(struct hc_set *s) {
67 hc_vector_clear(&s->items);

Callers 3

memo_releaseFunction · 0.85
hc_dsl_setenvFunction · 0.85
set_testsFunction · 0.85

Calls 2

hc_set_indexFunction · 0.85
hc_vector_insertFunction · 0.85

Tested by 1

set_testsFunction · 0.68