From a5ad7a5a06c866e7ce197fe08fcc657fa8089311 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 9 Jul 2011 06:16:36 -0700 Subject: [PATCH] =?utf8?q?S=5Freturn=5Flvalues:=20micro=C3=B6ptimisation?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This jumps over an if() condition when we know it’s going to be true. --- pp_ctl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pp_ctl.c b/pp_ctl.c index 554e47f..5fd7bf5 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -2313,6 +2313,7 @@ S_return_lvalues(pTHX_ SV **mark, SV **sp, SV **newsp, I32 gimme, SvREADONLY(TOPs) ? (TOPs == &PL_sv_undef) ? "undef" : "a readonly value" : "a temporary"); } + goto copy_sv; } else { /* sub:lvalue{} will take us here. */ @@ -2328,6 +2329,7 @@ S_return_lvalues(pTHX_ SV **mark, SV **sp, SV **newsp, I32 gimme, } } if (MARK < SP) { + copy_sv: if (cx->blk_sub.cv && CvDEPTH(cx->blk_sub.cv) > 1) { *++newsp = SvREFCNT_inc(*SP); FREETMPS; -- 2.7.4