diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-10-18 20:42:30 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-10-18 20:42:30 +0000 |
commit | c62eb2047c09034e319c2e6d5aaba369cad92b76 (patch) | |
tree | 816a4bc238bb8aec2097a77a84f860e900701ebf /toke.c | |
parent | 024963f8e0e4bfbd631d6878a69f86cabc760a32 (diff) | |
download | perl-c62eb2047c09034e319c2e6d5aaba369cad92b76.tar.gz |
It seems crazy for Perl_yylex() to individually shift each element off
PL_preambleav, and then free each in turn, rather than simply process
the array in place, and allow the sv_free(PL_preambleav) to dispose of
everything.
p4raw-id: //depot/perl@32140
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -3611,12 +3611,13 @@ Perl_yylex(pTHX) } } else sv_setpvs(PL_linestr,""); - if (PL_preambleav){ - while(AvFILLp(PL_preambleav) >= 0) { - SV *tmpsv = av_shift(PL_preambleav); - sv_catsv(PL_linestr, tmpsv); + if (PL_preambleav) { + SV **svp = AvARRAY(PL_preambleav); + SV **const end = svp + AvFILLp(PL_preambleav); + while(svp <= end) { + sv_catsv(PL_linestr, *svp); + ++svp; sv_catpvs(PL_linestr, ";"); - sv_free(tmpsv); } sv_free((SV*)PL_preambleav); PL_preambleav = NULL; |