Permalink
Browse files

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

  • Loading branch information...
khwilliamson committed Nov 23, 2017
1 parent e4bb6c9 commit 830f7694dc95a2a02f78f60b13e01079a0776245
Showing with 2 additions and 7 deletions.
  1. +2 −7 toke.c
View
9 toke.c
@@ -1019,13 +1019,8 @@ 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 = utf8_variant_count((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 830f769

Please sign in to comment.