Using explicit printf-like APIs with a format of "%s" isn't the world's
Nicholas Clark [Wed, 18 Oct 2006 19:11:55 +0000 (19:11 +0000)]
most efficient idea.

p4raw-id: //depot/perl@29042

XSUB.h
dump.c

diff --git a/XSUB.h b/XSUB.h
index e4cc816..1bf88d5 100644 (file)
--- a/XSUB.h
+++ b/XSUB.h
@@ -295,7 +295,7 @@ Rethrows a previously caught exception.  See L<perlguts/"Exception Handling">.
                                    vn = "VERSION"), FALSE);            \
        }                                                               \
        if (_sv) {                                                      \
-           SV *xssv = Perl_newSVpvf(aTHX_ "%s",XS_VERSION);            \
+           SV *xssv = Perl_newSVpv(aTHX_ XS_VERSION, 0);               \
            xssv = new_version(xssv);                                   \
            if ( !sv_derived_from(_sv, "version") )                     \
                _sv = new_version(_sv);                         \
diff --git a/dump.c b/dump.c
index c61516b..4805536 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -280,12 +280,12 @@ Perl_pv_pretty( pTHX_ SV *dsv, char const * const str, const STRLEN count,
         sv_setpvn(dsv, "", 0);
         
     if ( start_color != NULL ) 
-        Perl_sv_catpvf( aTHX_ dsv, "%s", start_color);
+        Perl_sv_catpv( aTHX_ dsv, start_color);
     
     pv_escape( dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR );    
     
     if ( end_color != NULL ) 
-        Perl_sv_catpvf( aTHX_ dsv, "%s", end_color);
+        Perl_sv_catpv( aTHX_ dsv, end_color);
 
     if ( dq == '"' ) 
        sv_catpvn( dsv, "\"", 1 );