On Wed, Aug 30, 2017 at 06:59:22PM +0000, Jeff Hostetler wrote:
> [snip]
> +/*
> + * Re-enable item couting when adding/removing items.
> + * If counting is currently disabled, it will force count them.
The code always recounts them. Either the comment or the
code should be adjusted.
> + * This might be used after leaving a threaded section.
> + */
> +static inline void hashmap_enable_item_counting(struct hashmap *map)
> +{
> + void *item;
> + unsigned int n = 0;
> + struct hashmap_iter iter;
> +
> + hashmap_iter_init(map, &iter);
> + while ((item = hashmap_iter_next(&iter)))
> + n++;
> +
> + map->do_count_items = 1;
> + map->private_size = n;
> +}
Regards
Simon
--
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9