MCPcopy Create free account
hub / github.com/git/git / hashmap_enable_item_counting

Function hashmap_enable_item_counting

hashmap.h:540–554  ·  view source on GitHub ↗

* Re-enable item counting when adding/removing items. * If counting is currently disabled, it will force count them. * It WILL NOT automatically rehash them. */

Source from the content-addressed store, hash-verified

538 * It WILL NOT automatically rehash them.
539 */
540static 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

Callers 1

lazy_init_name_hashFunction · 0.85

Calls 2

hashmap_iter_initFunction · 0.85
hashmap_iter_nextFunction · 0.85

Tested by

no test coverage detected