| 137 | } |
| 138 | |
| 139 | void strmap_remove(struct strmap *map, const char *str, int free_value) |
| 140 | { |
| 141 | struct strmap_entry entry, *ret; |
| 142 | hashmap_entry_init(&entry.ent, strhash(str)); |
| 143 | entry.key = str; |
| 144 | ret = hashmap_remove_entry(&map->map, &entry, ent, NULL); |
| 145 | if (!ret) |
| 146 | return; |
| 147 | if (free_value) |
| 148 | free(ret->value); |
| 149 | if (!map->pool) |
| 150 | free(ret); |
| 151 | } |
| 152 | |
| 153 | void strintmap_incr(struct strintmap *map, const char *str, intptr_t amt) |
| 154 | { |
no test coverage detected