Skip to content

Commit e695179

Browse files
committed
utf8_to_uv_msgs: Remove redundant conditionals
The comments added to the code in this commit explain that to get here, something needs to be done; no need to test again.
1 parent 061644d commit e695179

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

utf8.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,9 +2461,9 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0,
24612461
}
24622462
} /* End of switch() on the possible problems */
24632463

2464-
/* Display or save the message (if any) for the problem being
2465-
* handled in this iteration of the loop */
2466-
if (message) {
2464+
/* We only get here if there is a message to be displayed or
2465+
* returned; each case statement in the switch above does a
2466+
* continue if no message for it need be generated. */
24672467
if (msgs) {
24682468
if (msgs_return == NULL) {
24692469
msgs_return = newAV();
@@ -2479,7 +2479,7 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0,
24792479
: pack_warn),
24802480
this_flag_bit)));
24812481
}
2482-
else if (! (flags & UTF8_CHECK_ONLY)) {
2482+
else {
24832483
if (UNLIKELY(flags & ( UTF8_DIE_IF_MALFORMED
24842484
|UTF8_FORCE_WARN_IF_MALFORMED)))
24852485
{
@@ -2508,7 +2508,6 @@ Perl_utf8_to_uv_msgs_helper_(const U8 * const s0,
25082508
LEAVE;
25092509
}
25102510
}
2511-
}
25122511
} /* End of 'while (possible_problems)' */
25132512

25142513
if (msgs_return) {

0 commit comments

Comments
 (0)