diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-11-18 20:27:15 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-11-18 20:27:15 -0800 |
commit | d3cd8e110d9ca180ad6cfb8eccb46fb165e3e28c (patch) | |
tree | c02073c29762d757debf9610da8cc3a2b510f9d5 | |
parent | 2836693588eb28b4707239cc6f6c72b3c54749ad (diff) | |
download | perl-d3cd8e110d9ca180ad6cfb8eccb46fb165e3e28c.tar.gz |
Don’t create an AV for unfiltered code
When there are no source filters, we don’t need to create an AV to
hold them. The code for adding a filter already does a null check.
-rw-r--r-- | toke.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -715,8 +715,12 @@ Perl_lex_start(pTHX_ SV *line, PerlIO *rsfp, U32 flags) parser->rsfp = rsfp; parser->rsfp_filters = !(flags & LEX_START_SAME_FILTER) || !oparser - ? newAV() - : MUTABLE_AV(SvREFCNT_inc(oparser->rsfp_filters)); + ? NULL + : MUTABLE_AV(SvREFCNT_inc( + oparser->rsfp_filters + ? oparser->rsfp_filters + : (oparser->rsfp_filters = newAV()) + )); Newx(parser->lex_brackstack, 120, char); Newx(parser->lex_casestack, 12, char); |