Permalink
Browse files

toke.c: lex_stuff_pvn() Use faster UTF-8 variant count

  • Loading branch information...
khwilliamson committed Nov 23, 2017
1 parent 5559dda commit f11052e5aaab1038b570962afe8f03d6766eb24a
Showing with 3 additions and 7 deletions.
  1. +3 −7 toke.c
View
10 toke.c
@@ -1019,13 +1019,9 @@ Perl_lex_stuff_pvn(pTHX_ const char *pv, STRLEN len, U32 flags)
if (flags & LEX_STUFF_UTF8) {
goto plain_copy;
} else {
STRLEN highhalf = 0; /* Count of variants */
const char *p, *e = pv+len;
for (p = pv; p != e; p++) {
if (! UTF8_IS_INVARIANT(*p)) {
highhalf++;
}
}
STRLEN highhalf = variant_under_utf8_count((U8 *) pv,
(U8 *) pv + len);
const char *p, *e = pv+len;;
if (!highhalf)
goto plain_copy;
lex_grow_linestr(SvCUR(PL_parser->linestr)+1+len+highhalf);

0 comments on commit f11052e

Please sign in to comment.