This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_subst: compact a couple of PUSHes using ?:
authorDavid Mitchell <davem@iabyn.com>
Fri, 4 Feb 2011 17:45:47 +0000 (17:45 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sun, 6 Feb 2011 21:34:43 +0000 (21:34 +0000)
pp_hot.c

index 0a2194a..34f7770 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2279,10 +2279,7 @@ PP(pp_subst)
            }
            TAINT_IF(rxtainted & 1);
            SPAGAIN;
-           if (rpm->op_pmflags & PMf_NONDESTRUCT)
-               PUSHs(TARG);
-           else
-               PUSHs(&PL_sv_yes);
+           PUSHs(rpm->op_pmflags & PMf_NONDESTRUCT ? TARG : &PL_sv_yes);
        }
        else {
            do {
@@ -2416,10 +2413,7 @@ PP(pp_subst)
 
 ret_no:
     SPAGAIN;
-    if (rpm->op_pmflags & PMf_NONDESTRUCT)
-       PUSHs(TARG);
-    else
-       PUSHs(&PL_sv_no);
+    PUSHs(rpm->op_pmflags & PMf_NONDESTRUCT ? TARG : &PL_sv_no);
     LEAVE_SCOPE(oldsave);
     RETURN;
 }