Skip to content

Commit 252976a

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 de313d8 commit 252976a

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
@@ -4529,7 +4529,7 @@ PP_wrapped(pp_uc, 1, 0)
45294529
STRLEN ulen;
45304530
UV uv;
45314531
if (UNLIKELY(in_iota_subscript)) {
4532-
UV cp = utf8_to_uv_or_die(s, send, NULL);
4532+
UV cp = utf8_to_uv_or_die(s, send, &u);
45334533

45344534
if (! _invlist_contains_cp(PL_utf8_mark, cp)) {
45354535

@@ -4539,11 +4539,13 @@ PP_wrapped(pp_uc, 1, 0)
45394539
in_iota_subscript = FALSE;
45404540
}
45414541
}
4542+
else {
4543+
u = UTF8SKIP(s);
4544+
}
45424545

45434546
/* Then handle the current character. Get the changed case value
45444547
* and copy it to the output buffer */
45454548

4546-
u = UTF8SKIP(s);
45474549
#ifdef USE_LOCALE_CTYPE
45484550
uv = _toUPPER_utf8_flags(s, send, tmpbuf, &ulen, IN_LC_RUNTIME(LC_CTYPE));
45494551
#else

0 commit comments

Comments
 (0)