Thread (9 messages) flat view 9 messages, 3 authors, 2016-06-15

Re: [PATCH 3/3] implement pattern matching in ce_path_match

From: Sverre Rabbelier <hidden>
Date: 2016-06-15 22:45:57

On Wed, Jan 14, 2009 at 16:44, Johannes Schindelin
[off-list ref] wrote:
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help