summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-10-05 19:48:27 +0000
committerNicholas Clark <nick@ccl4.org>2007-10-05 19:48:27 +0000
commit5e7aa789c35577c2a092ac2f2d75bcee74e9b7f1 (patch)
treefc741efdbe8431008d864aed677b5905f676d839 /utf8.c
parent85aaa9347a943c63cdf17ef4ee9c73294929e278 (diff)
downloadperl-5e7aa789c35577c2a092ac2f2d75bcee74e9b7f1.tar.gz
Eliminate most *printf-like calls that use a simple "%c" format,
replacing them with constructions that are more efficient because they avoid the overhead of the *printf format parser and interpreter code. p4raw-id: //depot/perl@32034
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/utf8.c b/utf8.c
index a761d82a4b..c665a417ce 100644
--- a/utf8.c
+++ b/utf8.c
@@ -2167,12 +2167,14 @@ Perl_pv_uni_display(pTHX_ SV *dsv, const U8 *spv, STRLEN len, STRLEN pvlim, UV f
default: break;
}
if (ok) {
- Perl_sv_catpvf(aTHX_ dsv, "\\%c", ok);
+ const unsigned char string = (unsigned char) ok;
+ sv_catpvn(dsv, &string, 1);
}
}
/* isPRINT() is the locale-blind version. */
if (!ok && (flags & UNI_DISPLAY_ISPRINT) && isPRINT(c)) {
- Perl_sv_catpvf(aTHX_ dsv, "%c", c);
+ const unsigned char string = (unsigned char) c;
+ sv_catpvn(dsv, &string, 1);
ok = 1;
}
}