summaryrefslogtreecommitdiff
path: root/toke.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 /toke.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 'toke.c')
-rw-r--r--toke.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index be7bacf564..7037a433f6 100644
--- a/toke.c
+++ b/toke.c
@@ -12510,8 +12510,10 @@ Perl_yyerror(pTHX_ const char *s)
SV * const where_sv = sv_2mortal(newSVpvs("next char "));
if (yychar < 32)
Perl_sv_catpvf(aTHX_ where_sv, "^%c", toCTRL(yychar));
- else if (isPRINT_LC(yychar))
- Perl_sv_catpvf(aTHX_ where_sv, "%c", yychar);
+ else if (isPRINT_LC(yychar)) {
+ const unsigned char string = (unsigned char) yychar;
+ sv_catpvn(where_sv, &string, 1);
+ }
else
Perl_sv_catpvf(aTHX_ where_sv, "\\%03o", yychar & 255);
where = SvPVX_const(where_sv);