Skip to content

Commit

Permalink
locale.c: Reorder 'if' branches
Browse files Browse the repository at this point in the history
It's better for understandability to have positive tests than negative
ones
  • Loading branch information
khwilliamson committed Apr 29, 2021
1 parent 9c22770 commit f1d88f3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions locale.c
Expand Up @@ -1643,14 +1643,14 @@ S_new_numeric(pTHX_ const char *newnum)
# endif

/* Save the new name if it isn't the same as the previous one, if any */
if (! PL_numeric_name || strNE(PL_numeric_name, save_newnum)) {
if (PL_numeric_name && strEQ(PL_numeric_name, save_newnum)) {
Safefree(save_newnum);
}
else {
/* Save the locale name for future use */
Safefree(PL_numeric_name);
PL_numeric_name = save_newnum;
}
else {
Safefree(save_newnum);
}

PL_numeric_underlying_is_standard = PL_numeric_standard;

Expand Down

0 comments on commit f1d88f3

Please sign in to comment.