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

Re: [PATCH] hash: fix lookup_hash semantics

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Feb 22, 2008, 20:42 UTC
Message-ID
<alpine.LFD.1.00.0802221233410.21332@woody.linux-foundation.org>
In-Reply-To
<20080222194726.GA24532@sigill.intra.peff.net>
On Fri, 22 Feb 2008, Jeff King wrote:
Show 5 quoted lines
>
> We were returning the _address of_ the stored item (or NULL)
> instead of the item itself. While this sort of indirection
> is useful for insertion (since you can lookup and then
> modify), it is unnecessary for read-only lookup.

Gaah. That code returned the pointer-to-a-pointer exactly because of the insert case, but then to clean it up I had split it up into that internal "lookup_hash_entry()" case, but left the broken semantics for lookup_hash().

Stupid.

Your patch is obviously correct, and should probably go into maint just so that no other code makes the mistake of using that broken interface.

		Linus
Previous: Jeff KingNext: Junio C Hamano
Message 2 of 4 in “hash: fix lookup_hash semantics”
  1. hash: fix lookup_hash semanticsJeff King, Feb 22, 2008
  2. Linus TorvaldsFeb 22, 2008
  3. Junio C HamanoFeb 22, 2008
  4. Pieter de BieFeb 22, 2008

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.