Skip to content

Commit

Permalink
locale.c: Flatten two nested if's
Browse files Browse the repository at this point in the history
These can be combined into a single more cohesive construct
  • Loading branch information
khwilliamson committed May 6, 2023
1 parent 05054ac commit 91ffe2a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions locale.c
Expand Up @@ -1330,13 +1330,11 @@ S_querylocale_2008_i(pTHX_ const unsigned int index)

# ifdef USE_PL_CURLOCALES

/* We have up-to-date values when we keep our own records,
* except sometimes, LC_ALL */
if (index == LC_ALL_INDEX_) {
if (PL_curlocales[LC_ALL_INDEX_] == NULL) {
PL_curlocales[LC_ALL_INDEX_] =
/* PL_curlocales[] is kept up-to-date for all categories except LC_ALL,
* which may be invalidated, and if so, should now be calculated. */
if (index == LC_ALL_INDEX_ && PL_curlocales[LC_ALL_INDEX_] == NULL) {
PL_curlocales[LC_ALL_INDEX_] =
savepv(calculate_LC_ALL_string((const char **) &PL_curlocales));
}
}

retval = mortalized_pv_copy(PL_curlocales[index]);
Expand Down

0 comments on commit 91ffe2a

Please sign in to comment.