Skip to content

locale.c: Reverse order of conditionals #23575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from

Conversation

khwilliamson
Copy link
Contributor

Place the trivial case first; this also removes complementing the conditional.

These make it easier to read

  • This set of changes does not require a perldelta entry.

Place the trivial case first; this also removes complementing the
conditional.

These make it easier to read
@khwilliamson khwilliamson changed the title locale.c: Reverse conditional locale.c: Reverse order of conditionals Aug 15, 2025
if (is_locale_utf8(locale)) {
locale_utf8ness = LOCALE_IS_UTF8;
}
else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe drop the curlys for less whitespace/more code on 1 screen for the if()?

Its upto you, I dont have much of an opinion either way.

LOCALE_IS_UTF8 is a const from an enum according to grep, not a STMT_START { thing or a complicated long expression so I dont see a real or paranoia precedence/syntax error hazard here for inserting {} for a 1 liner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants