Skip to content

Commit

Permalink
locale.c: Reorder code, rmv unneeded conditional
Browse files Browse the repository at this point in the history
Previous commits have made the conditional about being able to find the
radix character unnecessary.  The called function my_langinfo_c()
handles the case properly.

This commit also makes the trivial case first in a conditional, as that
is easier to comprehend.
  • Loading branch information
khwilliamson committed May 6, 2021
1 parent b98f102 commit f8ba1d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions locale.c
Expand Up @@ -1518,8 +1518,11 @@ S_set_numeric_radix(pTHX_ const bool use_locale)
/* If 'use_locale' is FALSE, set to use a dot for the radix character. If
* TRUE, use the radix character derived from the current locale */

# if defined(USE_LOCALE_NUMERIC) && ( defined(HAS_SOME_LOCALECONV) \
|| defined(HAS_SOME_LANGINFO))
# ifndef USE_LOCALE_NUMERIC

PERL_UNUSED_ARG(use_locale);

# else

int utf8ness = 1;
const char * radix;
Expand All @@ -1544,11 +1547,8 @@ S_set_numeric_radix(pTHX_ const bool use_locale)
DEBUG_L(PerlIO_printf(Perl_debug_log, "Locale radix is '%s', ?UTF-8=%d\n",
SvPVX(PL_numeric_radix_sv),
cBOOL(SvUTF8(PL_numeric_radix_sv))));
# else

PERL_UNUSED_ARG(use_locale);

# endif /* USE_LOCALE_NUMERIC and can find the radix char */
# endif /* USE_LOCALE_NUMERIC */

}

Expand Down

0 comments on commit f8ba1d1

Please sign in to comment.