Skip to content

Commit ddad63e

Browse files
committed
pp.c Avoid a UTF8SKIP
This value is returned by the called function in one branch of the conditional, so we only need to calculate it in the other branch.
1 parent b4ca313 commit ddad63e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4597,7 +4597,7 @@ PP_wrapped(pp_uc, 1, 0)
45974597
STRLEN ulen;
45984598
UV uv;
45994599
if (UNLIKELY(in_iota_subscript)) {
4600-
UV cp = utf8_to_uv_or_die(s, send, NULL);
4600+
UV cp = utf8_to_uv_or_die(s, send, &u);
46014601

46024602
if (! _invlist_contains_cp(PL_utf8_mark, cp)) {
46034603

@@ -4607,11 +4607,13 @@ PP_wrapped(pp_uc, 1, 0)
46074607
in_iota_subscript = FALSE;
46084608
}
46094609
}
4610+
else {
4611+
u = UTF8SKIP(s);
4612+
}
46104613

46114614
/* Then handle the current character. Get the changed case value
46124615
* and copy it to the output buffer */
46134616

4614-
u = UTF8SKIP(s);
46154617
#ifdef USE_LOCALE_CTYPE
46164618
uv = _toUPPER_utf8_flags(s, send, tmpbuf, &ulen, IN_LC_RUNTIME(LC_CTYPE));
46174619
#else

0 commit comments

Comments
 (0)