This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pad.c: Use UTF8f for ‘will not stay shared’
authorFather Chrysostomos <sprout@cpan.org>
Mon, 24 Nov 2014 08:05:33 +0000 (00:05 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 30 Nov 2014 19:48:37 +0000 (11:48 -0800)
This is more efficient than creating a temporary SV.

pad.c

diff --git a/pad.c b/pad.c
index 34c0d9d..e7392ab 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -1234,9 +1234,8 @@ S_pad_findlex(pTHX_ const char *namepv, STRLEN namelen, U32 flags, const CV* cv,
                         && warn && ckWARN(WARN_CLOSURE)) {
                        newwarn = 0;
                        Perl_warner(aTHX_ packWARN(WARN_CLOSURE),
-                           "Variable \"%"SVf"\" will not stay shared",
-                            SVfARG(newSVpvn_flags(namepv, namelen,
-                                                  SVs_TEMP|SVf_UTF8)));
+                           "Variable \"%"UTF8f"\" will not stay shared",
+                            UTF8fARG(1, namelen, namepv));
                    }
 
                    if (fake_offset && CvANON(cv)