This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Modify S_pending_ident to use sv_catpvn_flags
authorFather Chrysostomos <sprout@cpan.org>
Fri, 30 Sep 2011 19:15:09 +0000 (12:15 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 6 Oct 2011 20:01:20 +0000 (13:01 -0700)
with the new SV_CAT* constants, since that’s faster than creating an
SV to pass to sv_catsv.

toke.c

diff --git a/toke.c b/toke.c
index a99868e..5f2f25e 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -8374,7 +8374,7 @@ S_pending_ident(pTHX)
                HEK * const stashname = HvNAME_HEK(stash);
                SV *  const sym = newSVhek(stashname);
                 sv_catpvs(sym, "::");
-                sv_catsv(sym, newSVpvn_flags(PL_tokenbuf+1, tokenbuf_len - 1, SVs_TEMP | (UTF ? SVf_UTF8 : 0 )));
+                sv_catpvn_flags(sym, PL_tokenbuf+1, tokenbuf_len - 1, (UTF ? SV_CATUTF8 : SV_CATBYTES ));
                 pl_yylval.opval = (OP*)newSVOP(OP_CONST, 0, sym);
                 pl_yylval.opval->op_private = OPpCONST_ENTERED;
                 gv_fetchsv(sym,