Skip to content

Commit

Permalink
locale.c: Reorder #if clauses
Browse files Browse the repository at this point in the history
Currently, the two clauses are about the same length, but in the next
commit the current first clause will become a lot longer.

The principal that it's easier to read code that disposes of the easy
cases first comes into play, so, reverse the clause order.
  • Loading branch information
khwilliamson committed May 6, 2023
1 parent 69075d0 commit d1c7a6c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions locale.c
Original file line number Diff line number Diff line change
Expand Up @@ -1321,16 +1321,9 @@ S_querylocale_2008_i(pTHX_ const unsigned int index)
}
else {

# ifdef USE_QUERYLOCALE

/* We don't currently keep records when there is querylocale(), so have
* to get it anew each time */
retval = (index == LC_ALL_INDEX_)
? calculate_LC_ALL_string(NULL)
: querylocale_l(index, cur_obj);
# else
# ifdef USE_PL_CURLOCALES

/* But we do have up-to-date values when we keep our own records,
/* 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) {
Expand All @@ -1341,6 +1334,13 @@ S_querylocale_2008_i(pTHX_ const unsigned int index)

retval = mortalized_pv_copy(PL_curlocales[index]);

# else /* No PL_CURLOCALES means must have some form of querylocale */

/* We don't currently keep records when there is querylocale(), so have
* to get it anew each time */
retval = (index == LC_ALL_INDEX_)
? calculate_LC_ALL_string(NULL)
: querylocale_l(index, cur_obj);
# endif

}
Expand Down

0 comments on commit d1c7a6c

Please sign in to comment.