refactor some common logic in regexec.c
Yves Orton [Sun, 4 Oct 2009 15:00:10 +0000 (17:00 +0200)]
regexec.c

index 221e360..83d216b 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -3483,17 +3483,11 @@ S_regmatch(pTHX_ regmatch_info *reginfo, regnode *prog)
                    nextchr = UCHARAT(locinput);
                    break;
                }
-               if (!(OP(scan) == SPACE
-                     ? isSPACE(nextchr) : isSPACE_LC(nextchr)))
-                   sayNO;
-               nextchr = UCHARAT(++locinput);
-           }
-           else {
-               if (!(OP(scan) == SPACE
-                     ? isSPACE(nextchr) : isSPACE_LC(nextchr)))
-                   sayNO;
-               nextchr = UCHARAT(++locinput);
            }
+           if (!(OP(scan) == SPACE
+                 ? isSPACE(nextchr) : isSPACE_LC(nextchr)))
+               sayNO;
+           nextchr = UCHARAT(++locinput);
            break;
        case NSPACEL:
            PL_reg_flags |= RF_tainted;