Skip to content

Commit 6b6e7eb

Browse files
committed
utf8n_to_uv_msgs: Move code to earlier in function
This enables simplifications in the next commits.
1 parent 0fa334a commit 6b6e7eb

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

inline.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3003,6 +3003,14 @@ Perl_utf8n_to_uvchr_msgs(const U8 *s,
30033003

30043004
PERL_ARGS_ASSERT_UTF8N_TO_UVCHR_MSGS;
30053005

3006+
/* Assume that isn't malformed; the vast majority of calls won't be */
3007+
if (errors) {
3008+
*errors = 0;
3009+
}
3010+
if (msgs) {
3011+
*msgs = NULL;
3012+
}
3013+
30063014
/* This dfa is fast. If it accepts the input, it was for a well-formed,
30073015
* non-problematic code point, which can be returned immediately.
30083016
* Otherwise we call a helper function to figure out the more complicated
@@ -3050,12 +3058,6 @@ Perl_utf8n_to_uvchr_msgs(const U8 *s,
30503058
if (retlen) {
30513059
*retlen = s - s0 + 1;
30523060
}
3053-
if (errors) {
3054-
*errors = 0;
3055-
}
3056-
if (msgs) {
3057-
*msgs = NULL;
3058-
}
30593061

30603062
return uv;
30613063
}

0 commit comments

Comments
 (0)