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

Re: [PATCH] sha1_file: add slash once in for_each_file_in_obj_subdir()

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 10, 2017, 02:10 UTC
Message-ID
<xmqq8tjx82kf.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170710000638.p7foedomfmdakyww@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> ... And you could even drop origlen by
> replacing it with "baselen - 3" at the end. But somehow doing the
> computation on the fly actually seems more complicated to me (from the
> perspective of a reader who is trying to make sure all is correct).

True enough. I personally do not mind any of the three variants (including the original) and would rather not spend too much time micro-optimizing this codepath, lest the next clever person starts to turn the loop in for_each_loose_file_in_objdir() to a nested loop that runs 16 times each to avoid copying the same leading byte again and again ;-)

Previous: Jeff KingNext: René Scharfe
Message 6 of 7 in “sha1_file: add slash once in for_each_file_in_obj_subdir()”
  1. sha1_file: add slash once in for_each_file_in_obj_subdir()René Scharfe, Jul 8, 2017
  2. Jeff KingJul 9, 2017
  3. René ScharfeJul 9, 2017
  4. Junio C HamanoJul 9, 2017
  5. Jeff KingJul 10, 2017
  6. Junio C HamanoJul 10, 2017
  7. René ScharfeJul 12, 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.