This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_subst: move a bock of code to to decrease gotos
authorDavid Mitchell <davem@iabyn.com>
Fri, 4 Feb 2011 17:54:11 +0000 (17:54 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sun, 6 Feb 2011 21:34:43 +0000 (21:34 +0000)
pp_hot.c

index 34f7770..494c50f 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2216,8 +2216,13 @@ PP(pp_subst)
        doutf8 = FALSE;
     }
     
-    if (!matched)
-       goto ret_no;
+    if (!matched) {
+      ret_no:
+       SPAGAIN;
+       PUSHs(rpm->op_pmflags & PMf_NONDESTRUCT ? TARG : &PL_sv_no);
+       LEAVE_SCOPE(oldsave);
+       RETURN;
+    }
 
     /* can do inplace substitution? */
     if (c
@@ -2410,12 +2415,6 @@ PP(pp_subst)
        RETURN;
     }
     /* NOTREACHED */
-
-ret_no:
-    SPAGAIN;
-    PUSHs(rpm->op_pmflags & PMf_NONDESTRUCT ? TARG : &PL_sv_no);
-    LEAVE_SCOPE(oldsave);
-    RETURN;
 }
 
 PP(pp_grepwhile)