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

Re: [PATCH 00/10] Friday night special: hash map cleanup

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 5, 2017, 20:51 UTC
Message-ID
<xmqqmv8ihaj7.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170701002838.22785-1-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 11 quoted lines
> This goes on top of sb/hashmap-customize-comparison.
> No functional impact but a pure cleanup series:
> No casts to hashmap_cmp_fn in the whole code base any more.
>
> This revealed another interesting thing, which is not a bug per se:
> The const correctness of hashmap_cmp_fn as it requires all its void
> pointers to be const!
>
> We violate this in patch-ids.c as we modify the `fndata` at some
> uncritical part (a part that doesn't change the equal-functionality
> AFAICT).

I am undecided, but perhaps we should loosen that, if some real-world user has a legitimate need to take a mutable fndata?

I dunno.  The patches look good to me.
Thanks.
Previous: Stefan Beller
Message 12 of 12 in “Friday night special: hash map cleanup”
  1. 00/10 Friday night special: hash map cleanupStefan Beller, Jul 1, 2017
  2. 01/10 attr.c: drop hashmap_cmp_fn castStefan Beller, Jul 1, 2017
  3. 02/10 builtin/difftool.c: drop hashmap_cmp_fn castStefan Beller, Jul 1, 2017
  4. 03/10 builtin/describe: drop hashmap_cmp_fn castStefan Beller, Jul 1, 2017
  5. 04/10 config.c: drop hashmap_cmp_fn castStefan Beller, Jul 1, 2017
  6. 09/10 name-hash.c: drop hashmap_cmp_fn castStefan Beller, Jul 1, 2017
  7. 10/10 t/helper/test-hashmap: use custom data instead of duplicate cmp functionsStefan Beller, Jul 1, 2017
  8. 08/10 submodule-config.c: drop hashmap_cmp_fn castStefan Beller, Jul 1, 2017
  9. 06/10 patch-ids.c: drop hashmap_cmp_fn castStefan Beller, Jul 1, 2017
  10. 05/10 convert/sub-process: drop cast to hashmap_cmp_fnStefan Beller, Jul 1, 2017
  11. 07/10 remote.c: drop hashmap_cmp_fn castStefan Beller, Jul 1, 2017
  12. Junio C HamanoJul 5, 2017

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.