This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Avoid some work
authorKarl Williamson <khw@cpan.org>
Tue, 2 Jan 2018 20:38:16 +0000 (13:38 -0700)
committerKarl Williamson <khw@cpan.org>
Wed, 31 Jan 2018 05:35:09 +0000 (22:35 -0700)
We've already worked out whether the decimal point is a dot or not.  We
can pass that information to the called routine so it doesn't have to
figure it out again.

locale.c

index 4e0015e..74f9ea9 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -560,7 +560,7 @@ Perl_set_numeric_underlying(pTHX)
     do_setlocale_c(LC_NUMERIC, PL_numeric_name);
     PL_numeric_standard = PL_numeric_underlying_is_standard;
     PL_numeric_underlying = TRUE;
-    set_numeric_radix(1);
+    set_numeric_radix(! PL_numeric_standard);
 
 #  ifdef DEBUGGING