diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-10-05 19:48:27 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-10-05 19:48:27 +0000 |
commit | 5e7aa789c35577c2a092ac2f2d75bcee74e9b7f1 (patch) | |
tree | fc741efdbe8431008d864aed677b5905f676d839 /toke.c | |
parent | 85aaa9347a943c63cdf17ef4ee9c73294929e278 (diff) | |
download | perl-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); |