diff options
author | Gisle Aas <gisle@aas.no> | 1998-07-07 13:48:11 +0200 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-08 02:30:55 +0000 |
commit | d426b052dee31c20224ef2893d5c969ad5a2c617 (patch) | |
tree | 0f15870d4f60c065379c6a4eba05c8157050abc9 /pp_hot.c | |
parent | 827b7e14e1e607ab4ad9d3216e9bea55f7e0b975 (diff) | |
download | perl-d426b052dee31c20224ef2893d5c969ad5a2c617.tar.gz |
Faster foreach integer range
Message-ID: <m3k95qm1pg.fsf@furu.g.aas.no>
p4raw-id: //depot/perl@1367
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -1459,7 +1459,14 @@ PP(pp_iter) /* integer increment */ if (cx->blk_loop.iterix > cx->blk_loop.itermax) RETPUSHNO; - sv_setiv(*cx->blk_loop.itervar, cx->blk_loop.iterix++); + + /* we know that the loop index SV is IV capable, so we can save + * some time by doing the essential work of sv_setiv() ourself. + */ + sv = *cx->blk_loop.itervar; + (void)SvIOK_only(sv); + SvIVX(sv) = cx->blk_loop.iterix++; + RETPUSHYES; } |