Skip to content

Commit

Permalink
locale.c: Reorder some statements in a switch()
Browse files Browse the repository at this point in the history
This unifies the common text in two case: statements, and makes all of
them do their business in the same order.

This makes it easier to compare and contrast the actions of the various
case:s
  • Loading branch information
khwilliamson committed Nov 22, 2023
1 parent 76eef9e commit 9b3375c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions locale.c
Expand Up @@ -5542,31 +5542,30 @@ S_my_localeconv(pTHX_ const int item)
# ifdef USE_LOCALE_NUMERIC

case RADIXCHAR:
locale = numeric_locale = PL_numeric_name;
index_bits = OFFSET_TO_BIT(NUMERIC_OFFSET);
strings[NUMERIC_OFFSET] = DECIMAL_POINT_ADDRESS;
integers = NULL;
break;
goto numeric_common;

case THOUSEP:
index_bits = OFFSET_TO_BIT(NUMERIC_OFFSET);
locale = numeric_locale = PL_numeric_name;
strings[NUMERIC_OFFSET] = thousands_sep_string;

numeric_common:
integers = NULL;
index_bits = OFFSET_TO_BIT(NUMERIC_OFFSET);
locale = numeric_locale = PL_numeric_name;
break;

# endif
# ifdef USE_LOCALE_MONETARY

case CRNCYSTR:
index_bits = OFFSET_TO_BIT(MONETARY_OFFSET);
locale = monetary_locale = querylocale_i(LC_MONETARY_INDEX_);

/* This item needs the values for both the currency symbol, and
* another one used to construct the nl_langino()-compatible
* return. */
strings[MONETARY_OFFSET] = CURRENCY_SYMBOL_ADDRESS;
integers = P_CS_PRECEDES_ADDRESS;

index_bits = OFFSET_TO_BIT(MONETARY_OFFSET);
locale = monetary_locale = querylocale_i(LC_MONETARY_INDEX_);
break;

# endif
Expand Down

0 comments on commit 9b3375c

Please sign in to comment.