Skip to content

Commit f82bfff

Browse files
committed
toke.c: Avoid some UTF8SKIPs
This value is returnable from the called functions. Use it instead of re-deriving it
1 parent 9bc2524 commit f82bfff

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

toke.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2964,14 +2964,15 @@ Perl_get_and_check_backslash_N_name(pTHX_ const char* s,
29642964
s += 2;
29652965
}
29662966
else {
2967+
Size_t advance;
29672968
if (! _invlist_contains_cp(PL_utf8_charname_begin,
29682969
utf8_to_uv_or_die((const U8 *) s,
29692970
(const U8 *) e,
2970-
NULL)))
2971+
&advance)))
29712972
{
29722973
goto bad_charname;
29732974
}
2974-
s += UTF8SKIP(s);
2975+
s += advance;
29752976
}
29762977

29772978
while (s < e) {
@@ -2992,14 +2993,15 @@ Perl_get_and_check_backslash_N_name(pTHX_ const char* s,
29922993
s += 2;
29932994
}
29942995
else {
2996+
Size_t advance;
29952997
if (! _invlist_contains_cp(PL_utf8_charname_continue,
29962998
utf8_to_uv_or_die((const U8 *) s,
29972999
(const U8 *) e,
2998-
NULL)))
3000+
&advance)))
29993001
{
30003002
goto bad_charname;
30013003
}
3002-
s += UTF8SKIP(s);
3004+
s += advance;
30033005
}
30043006
}
30053007
}

0 commit comments

Comments
 (0)