* Re-enable item counting when adding/removing items. * If counting is currently disabled, it will force count them. * It WILL NOT automatically rehash them. */
| 538 | * It WILL NOT automatically rehash them. |
| 539 | */ |
| 540 | static inline void hashmap_enable_item_counting(struct hashmap *map) |
| 541 | { |
| 542 | unsigned int n = 0; |
| 543 | struct hashmap_iter iter; |
| 544 | |
| 545 | if (map->do_count_items) |
| 546 | return; |
| 547 | |
| 548 | hashmap_iter_init(map, &iter); |
| 549 | while (hashmap_iter_next(&iter)) |
| 550 | n++; |
| 551 | |
| 552 | map->do_count_items = 1; |
| 553 | map->private_size = n; |
| 554 | } |
| 555 | |
| 556 | /* String interning */ |
| 557 |
no test coverage detected