From: "Boyd Stephen Smith Jr." <bss@iguanasuicide.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [CLEANUP PATCH RESEND] git wrapper: Make while loop more reader-friendly
Date: Fri, 2 Jan 2009 12:28:03 -0600 [thread overview]
Message-ID: <200901021228.07599.bss@iguanasuicide.net> (raw)
In-Reply-To: <alpine.DEB.1.00.0901021240270.27818@racer>
[-- Attachment #1: Type: text/plain, Size: 969 bytes --]
On Friday 2009 January 02 12:07:52 you wrote:
> It is not a good practice to prefer performance over readability in
> something as performance uncritical as finding the trailing slash
> of argv[0].
>
> So avoid head-scratching by making the loop user-readable, and not
> hyper-performance-optimized.
> - do
> - --slash;
> - while (cmd <= slash && !is_dir_sep(*slash));
> + while (cmd <= slash && !is_dir_sep(*slash))
> + slash--;
What confused people? The predecrement or the do/while? Should people that
don't understand one of those be hacking on git?
That said, I'm not opposed to the patch. It is easier on the eyes, though I
prefer the one-liner:
for (; cmd <= slash && !is_dir_sep(*slash); --slash);
--
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss@iguanasuicide.net ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-'
http://iguanasuicide.net/ \_/
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2009-01-02 18:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-02 18:07 [CLEANUP PATCH RESEND] git wrapper: Make while loop more reader-friendly Johannes Schindelin
2009-01-02 18:28 ` Boyd Stephen Smith Jr. [this message]
2009-01-02 18:49 ` Johannes Schindelin
2009-01-02 20:04 ` Boyd Stephen Smith Jr.
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200901021228.07599.bss@iguanasuicide.net \
--to=bss@iguanasuicide.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox