git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Previous: Alexander Kuleshov
Message 2 of 2 in “hashmap API: introduce for_each_hashmap_entry() helper macro”
  1. hashmap API: introduce for_each_hashmap_entry() helper macroAlexander Kuleshov, Mar 17, 2016
  2. Karsten BleesMar 17, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.