Re: [PATCH 3/3] implement pattern matching in ce_path_match
- From
Sverre Rabbelier <srabbelier@gmail.com>
- Date
- Jan 14, 2009, 15:55 UTC
- Message-ID
- <bd6139dc0901140755n7e8cbf6eu7cf91279be463501@mail.gmail.com>
- 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:
Show 22 quoted lines
>> +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