Re: [PATCH v2] hashmap API: introduce for_each_hashmap_entry() helper macro
- From
Karsten Blees <karsten.blees@gmail.com>
- Date
- Mar 17, 2016, 22:39 UTC
- Message-ID
- <56EB3217.7090907@gmail.com>
- In-Reply-To
- <1458211127-26963-1-git-send-email-kuleshovmail@gmail.com>
Am 17.03.2016 um 11:38 schrieb Alexander Kuleshov:
> This patch introduces the for_each_hashmap_entry() macro for more
I'd rather call it 'hashmap_for_each', following the pattern 'operandtype_operation' used throughout git. E.g. we already have 'hashmap_get', not 'get_hashmap_entry'.
I realize that existing *for_each* implementations in the git code base are a bit of a mess (except 'sha1_array_for_each_unique'). E.g. there is 'for_each_string_list' and 'for_each_string_list_item'. Both loop over the string_list_items of a string_list, but one is named after the collection type, the other after the item type...IMO this shouldn't set an example for future code.
The rest of the patch looks good to me.