| 53 | } |
| 54 | |
| 55 | void *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 | |
| 66 | void hc_set_clear(struct hc_set *s) { |
| 67 | hc_vector_clear(&s->items); |