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

Re: [PATCH] hash: Remove useless init_hash()

From
Stephen Boyd <bebarino@gmail.com>
Date
Jul 28, 2010, 07:33 UTC
Message-ID
<4C4FDD63.9050303@gmail.com>
In-Reply-To
<AANLkTikHLZlBQW8DSZrxeA-RDOh2Iy6hc0p821tDQoN8@mail.gmail.com>
  On 07/27/2010 12:58 PM, Ævar Arnfjörð Bjarmason wrote:
Show 15 quoted lines
>
>> That being said, I agree with the comments that removing init_hash
>> actually makes the code _less_ readable. You could just replace these
>> three lines with a memset, but why? It's just code churn.
> Yeah, and for the record it also missed this part in hash.c:
>
>      void free_hash(struct hash_table *table)
>      {
>      	free(table->array);
>      	table->array = NULL;
>      	table->size = 0;
>      	table->nr = 0;
>      }
>
> Have fun everyone :)
Ok, seems like nobody thinks this is a good idea so I'm fine with dropping it. The minimal savings (if at all) doesn't seem worth the code churn. One less patch in the queue ;-)
Previous: Ævar Arnfjörð BjarmasonNext: Linus Torvalds
Message 6 of 7 in “hash: Remove useless init_hash()”
  1. hash: Remove useless init_hash()Stephen Boyd, Jul 27, 2010
  2. Jakub NarebskiJul 27, 2010
  3. Ævar Arnfjörð BjarmasonJul 27, 2010
  4. Jeff KingJul 27, 2010
  5. Ævar Arnfjörð BjarmasonJul 27, 2010
  6. Stephen BoydJul 28, 2010
  7. Linus TorvaldsJul 27, 2010

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.