regexec.c: Reorder cases in switch to eliminate a goto
authorKarl Williamson <public@khwilliamson.com>
Mon, 16 Sep 2013 03:16:10 +0000 (21:16 -0600)
committerKarl Williamson <public@khwilliamson.com>
Tue, 17 Sep 2013 05:13:12 +0000 (23:13 -0600)
I imagine that the goto gets optimized out, but this is clearer anyway;
considered less harmful.

regexec.c

index b98782d..b68eb97 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -3762,16 +3762,14 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
            sayNO_SILENT;
            assert(0); /*NOTREACHED*/
 
-       case EOL: /* /..$/  */
-               goto seol;
-
        case MEOL: /* /..$/m  */
            if (!NEXTCHR_IS_EOS && nextchr != '\n')
                sayNO;
            break;
 
+       case EOL: /* /..$/  */
+            /* FALL THROUGH */
        case SEOL: /* /..$/s  */
-         seol:
            if (!NEXTCHR_IS_EOS && nextchr != '\n')
                sayNO;
            if (reginfo->strend - locinput > 1)