diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2012-10-27 01:44:13 -0400 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-10-28 02:04:58 -0700 |
commit | b604e36642f9076ae759752939c26b3d5f5fc223 (patch) | |
tree | 2af288cf982f0f04cbfd352b0d594a2a1597f587 /toke.c | |
parent | 04fae10148c49c60f1578c0a2cb6ab08cd231927 (diff) | |
download | perl-b604e36642f9076ae759752939c26b3d5f5fc223.tar.gz |
rmv a sv_2mortal and unused var in toke.c:Perl_yyerror_pvn
newSVpvn_flags is capable of mortalizing already, use that, is_utf8 is used
only once, waste of an auto var stack slot to calculate it so early,
instead create the flags arg to newSVpvn_flags at the point of usage.
flags param of yyerror_pvn will always be on the C stack.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -11041,7 +11041,6 @@ Perl_yyerror_pvn(pTHX_ const char *const s, STRLEN len, U32 flags) SV *msg; SV * const where_sv = newSVpvs_flags("", SVs_TEMP); int yychar = PL_parser->yychar; - U32 is_utf8 = flags & SVf_UTF8; PERL_ARGS_ASSERT_YYERROR_PVN; @@ -11102,7 +11101,7 @@ Perl_yyerror_pvn(pTHX_ const char *const s, STRLEN len, U32 flags) else Perl_sv_catpvf(aTHX_ where_sv, "\\%03o", yychar & 255); } - msg = sv_2mortal(newSVpvn_flags(s, len, is_utf8)); + msg = newSVpvn_flags(s, len, (flags & SVf_UTF8) | SVs_TEMP); Perl_sv_catpvf(aTHX_ msg, " at %s line %"IVdf", ", OutCopFILE(PL_curcop), (IV)CopLINE(PL_curcop)); if (context) |