mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "René Scharfe" <>
To: Junio C Hamano <>, Jeff King <>
Cc: Git List <>
Subject: Re: [PATCH] sha1_file: add slash once in for_each_file_in_obj_subdir()
Date: Wed, 12 Jul 2017 19:58:37 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Am 10.07.2017 um 04:10 schrieb Junio C Hamano:
> Jeff King <> 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 ;-)

*evil grin*

Anyway, I agree that this patch is not worth spending much time on.  I
still think the result is cleaner (perhaps due to my strbuf_addf
allergy), though it's longer and perhaps adding a twelfth variable makes
the function too complicated.  The magic chomping variant is a clever
compromise -- but needs a comment to explain itself.  So if you are
indifferent please just drop it.


      reply	other threads:[~2017-07-12 17:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-08  8:59 [PATCH] sha1_file: add slash once in for_each_file_in_obj_subdir() René Scharfe
2017-07-09 11:00 ` Jeff King
2017-07-09 13:26   ` René Scharfe
2017-07-09 16:41   ` Junio C Hamano
2017-07-10  0:06     ` Jeff King
2017-07-10  2:10       ` Junio C Hamano
2017-07-12 17:58         ` René Scharfe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).