]> git.wincent.com - wikitext.git/commitdiff
Remove unnecessary parens
authorWincent Colaiuta <win@wincent.com>
Tue, 12 May 2009 20:36:18 +0000 (22:36 +0200)
committerWincent Colaiuta <win@wincent.com>
Tue, 12 May 2009 20:36:18 +0000 (22:36 +0200)
C operator precendence makes most of these parens unnecessary
so remove them.

We don't remove the parens around the "&&" expressions even
though they aren't necessary, because without them GCC will
warn "suggest parentheses around && within ||". Better to
have a warning-free build than shave off a few bytes at any
cost.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
ext/parser.c

index 8f17b379a5bdad1818325cbbbc62d7c3d2fe73c9..bee02bb6f9b9adb37774597c1f3e219274002a90 100644 (file)
@@ -853,13 +853,13 @@ static void _Wikitext_encode_link_target(parser_t *parser)
         }
 
         // pass through unreserved characters
-        if (((*src >= 'a') && (*src <= 'z')) ||
-            ((*src >= 'A') && (*src <= 'Z')) ||
-            ((*src >= '0') && (*src <= '9')) ||
-            (*src == '-') ||
-            (*src == '_') ||
-            (*src == '.') ||
-            (*src == '~'))
+        if ((*src >= 'a' && *src <= 'z') ||
+            (*src >= 'A' && *src <= 'Z') ||
+            (*src >= '0' && *src <= '9') ||
+            *src == '-' ||
+            *src == '_' ||
+            *src == '.' ||
+            *src == '~')
         {
             *dest++     = *src;
             non_space   = dest;