summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorTassilo von Parseval <tassilo.parseval@post.rwth-aachen.de>2005-10-25 10:11:42 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-10-26 10:21:30 +0000
commit0a75904b806e52eae8a54feaebd1661bb58649d4 (patch)
tree72cbb3e9568c69041a5d0b000de3a8ce528e895b /pp.c
parent12072db584c2e01bfc16caa132da271f7ae8e5d9 (diff)
downloadperl-0a75904b806e52eae8a54feaebd1661bb58649d4.tar.gz
Re: [PATCH] minor speed-up for pp_push()
Message-id: <20051025061141.GA2256@ethan> p4raw-id: //depot/perl@25854
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/pp.c b/pp.c
index db162815bb..834d32f283 100644
--- a/pp.c
+++ b/pp.c
@@ -4333,18 +4333,19 @@ PP(pp_push)
call_method("PUSH",G_SCALAR|G_DISCARD);
LEAVE;
SPAGAIN;
+ SP = ORIGMARK;
+ PUSHi( AvFILL(ary) + 1 );
}
else {
- /* Why no pre-extend of ary here ? */
for (++MARK; MARK <= SP; MARK++) {
SV * const sv = NEWSV(51, 0);
if (*MARK)
sv_setsv(sv, *MARK);
- av_push(ary, sv);
+ av_store(ary, AvFILLp(ary)+1, sv);
}
+ SP = ORIGMARK;
+ PUSHi( AvFILLp(ary) + 1 );
}
- SP = ORIGMARK;
- PUSHi( AvFILL(ary) + 1 );
RETURN;
}