git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sverre Rabbelier" <srabbelier@gmail.com>
To: "Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Cc: "Clemens Buchacher" <drizzd@aon.at>,
	git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
	johannes@familieschneider.info
Subject: Re: [PATCH 3/3] implement pattern matching in ce_path_match
Date: Wed, 14 Jan 2009 16:55:45 +0100	[thread overview]
Message-ID: <bd6139dc0901140755n7e8cbf6eu7cf91279be463501@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0901141641500.3586@pacific.mpi-cbg.de>

On Wed, Jan 14, 2009 at 16:44, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
>> +static int has_special(const char *p)
>> +{
>> +     int x;
>> +
>> +     while ((x = *p++) != '\0')
>> +             if (isspecial(x))
>> +                     return 1;
>> +
>> +     return 0;
>> +}
>
> I would prefer something like this:
>
>        static int has_special(const char *p)
>        {
>                while (*p)
>                        if (isspecial(*(p++)))
>                                return 1;
>                return 0;
>        }
>
> but that is probably a matter of taste.

FWIW, I think the above is a lot less readable due to the assignment
in the while loop's conditional. Whereas in Dscho's version it is
intuitively obvious what the termination condition of the while loop
is.

-- 
Cheers,

Sverre Rabbelier

  reply	other threads:[~2009-01-14 15:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-14 14:54 [PATCH 0/3] fix "git add" pattern matching Clemens Buchacher
2009-01-14 14:54 ` [PATCH 1/3] clean up pathspec matching Clemens Buchacher
2009-01-14 14:54   ` [PATCH 2/3] remove pathspec_match, use match_pathspec instead Clemens Buchacher
2009-01-14 14:54     ` [PATCH 3/3] implement pattern matching in ce_path_match Clemens Buchacher
2009-01-14 15:25       ` Clemens Buchacher
2009-01-14 15:44       ` Johannes Schindelin
2009-01-14 15:55         ` Sverre Rabbelier [this message]
2009-01-14 16:18         ` Samuel Tardieu
2009-01-14 16:53           ` Jeff King
2009-01-14 18:39       ` Junio C Hamano
2009-01-14 19:23         ` Clemens Buchacher
2009-01-14 22:27           ` Junio C Hamano
2009-01-15  8:20             ` Clemens Buchacher
2009-01-16  2:51         ` Junio C Hamano
2009-01-14 15:40     ` [PATCH 2/3] remove pathspec_match, use match_pathspec instead Johannes Schindelin
2009-01-14 16:09       ` Clemens Buchacher

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=bd6139dc0901140755n7e8cbf6eu7cf91279be463501@mail.gmail.com \
    --to=srabbelier@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=drizzd@aon.at \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes@familieschneider.info \
    /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;
as well as URLs for NNTP newsgroup(s).