summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <perlbug-followup@perl.org>2009-10-31 16:15:08 +0100
committerRafael Garcia-Suarez <rgs@consttype.org>2009-10-31 16:16:35 +0100
commit941446f6f52eecff56982518624db4f64a5951fc (patch)
tree6bef57c7a599cb2e30e713f3ed23731114203517 /pp.c
parente95d73140218cc53e63e359a04270e05457c786f (diff)
downloadperl-941446f6f52eecff56982518624db4f64a5951fc.tar.gz
[perl #69875] Slow down split in scalar context :-)
The patch to speed up split in scalar context broke Font::GlyphNames, because it stops scalar(@array = split) from working. The attached patch fixes this, and ineluctably slows it down slightly. (Patch amended by replacing the 2nd GIMME_V macro call by the gimme variable)
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 80bb590086..d0022fc538 100644
--- a/pp.c
+++ b/pp.c
@@ -4894,7 +4894,7 @@ PP(pp_split)
I32 realarray = 0;
I32 base;
const I32 gimme = GIMME_V;
- const bool gimme_scalar = (GIMME_V == G_SCALAR);
+ bool gimme_scalar;
const I32 oldsave = PL_savestack_ix;
U32 make_mortal = SVs_TEMP;
bool multiline = 0;
@@ -4968,6 +4968,8 @@ PP(pp_split)
multiline = 1;
}
+ gimme_scalar = gimme == G_SCALAR && !ary;
+
if (!limit)
limit = maxiters + 2;
if (RX_EXTFLAGS(rx) & RXf_WHITE) {