2007-11-26 Eric Seidel <eric@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 11:32:01 +0000 (11:32 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 11:32:01 +0000 (11:32 +0000)
        Reviewed by Mitz.

        Remove branch from return

        * pcre/pcre_compile.cpp:
        (compile_branch):
        * pcre/pcre_exec.cpp:
        (match):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28175 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/pcre/pcre_compile.cpp
JavaScriptCore/pcre/pcre_exec.cpp

index f4eaf372bd58d41e78b7111d62063bfa0d5c7f3b..eb3b7297b49b5a44b1cdff4c36f66dc16b5527d4 100644 (file)
         * pcre/pcre_exec.cpp:
         (match):
 
+2007-11-26  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Mitz.
+
+        Remove branch from return
+
+        * pcre/pcre_compile.cpp:
+        (compile_branch):
+        * pcre/pcre_exec.cpp:
+        (match):
+
 2007-11-26  Eric Seidel  <eric@webkit.org>
 
         Reviewed by Maciej.
index ede41c30ed53623611d67c5672af6c7d871f0a6a..05e68586fc01ae3bf28586f4eed8f5d4f41f3944 100644 (file)
@@ -1269,7 +1269,8 @@ compile_branch(int options, int* brackets, uschar** codeptr,
                     
                     if (code[-1] & 0x80) {
                         uschar *lastchar = code - 1;
-                        while((*lastchar & 0xc0) == 0x80) lastchar--;
+                        while((*lastchar & 0xc0) == 0x80)
+                            lastchar--;
                         c = code - lastchar;            /* Length of UTF-8 character */
                         memcpy(utf8_char, lastchar, c); /* Save the char */
                         c |= 0x80;                      /* Flag c as a length */
@@ -1285,7 +1286,8 @@ compile_branch(int options, int* brackets, uschar** codeptr,
                 
                 else if (*previous == OP_ASCII_CHAR || *previous == OP_ASCII_LETTER_NC) {
                     c = previous[1];
-                    if (repeat_min > 1) reqbyte = c | req_caseopt | cd.req_varyopt;
+                    if (repeat_min > 1)
+                        reqbyte = c | req_caseopt | cd.req_varyopt;
                     goto OUTPUT_SINGLE_REPEAT;
                 }
                 
index 389dd3f0af22944965489cfcecee2d4142ab39ce..d452779be482aa609386c182159f7bbeb53185ca 100644 (file)
@@ -1955,7 +1955,8 @@ RRETURN_SWITCH:
 #endif
     
 RETURN:
-    return is_match ? MATCH_MATCH : MATCH_NOMATCH;
+    ASSERT(is_match == MATCH_MATCH || is_match == MATCH_NOMATCH);
+    return is_match;
 }