Re: [PATCH 1/4] refspec: trivial cleanup
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- Dec 1, 2020, 23:25 UTC
- Message-ID
- <CAMP44s3usd5EW4sA6_qapnDBVRAWg4nk5ZSxAPPQN1UygD=ctA@mail.gmail.com>
- In-Reply-To
- <X8YsXjN7MQrLnytw@coredump.intra.peff.net>
On Tue, Dec 1, 2020 at 5:43 AM Jeff King <peff@peff.net> wrote:
Show 12 quoted lines
> > On Mon, Nov 30, 2020 at 06:46:46PM -0600, Felipe Contreras wrote: > > > We can remove one level of indentation and make the code clearer. So why > > not do so? > > I know your question was rhetorical, but a good reason not to do so in > general is that the existing pattern reveals some intent. E.g., it > sometimes is the case that with the _current_ code we can return early > from a function or loop, but that is not inherent to what the code is > doing, and the early return or continue makes it harder to understand > that.
Yes, but even in those cases it arguably helps readability.
Anyway, I prefer to argue on the tangible rather than hypotheticals because the hypotheticals are infinite.
In this particular case there's no particular reason to just continue if there's no prefix.
Cheers.
-- Felipe Contreras