From b604e36642f9076ae759752939c26b3d5f5fc223 Mon Sep 17 00:00:00 2001 From: Daniel Dragan Date: Sat, 27 Oct 2012 01:44:13 -0400 Subject: [PATCH] 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. --- toke.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/toke.c b/toke.c index 45468b3..e4c1f80 100644 --- a/toke.c +++ b/toke.c @@ -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) -- 2.7.4