This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_sv_2pv_flags: Potentially avoid work
authorKarl Williamson <khw@cpan.org>
Thu, 18 Jan 2018 22:56:33 +0000 (15:56 -0700)
committerKarl Williamson <khw@cpan.org>
Wed, 31 Jan 2018 05:58:15 +0000 (22:58 -0700)
By using a macro that is private to the core, this code can avoid
thinking it has to deal with a non-dot radix character, as even if we
are using the locale radix, that is often a dot.

sv.c

diff --git a/sv.c b/sv.c
index b0ae323..7717653 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -3143,7 +3143,7 @@ Perl_sv_2pv_flags(pTHX_ SV *const sv, STRLEN *const lp, const I32 flags)
                     DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
                     STORE_LC_NUMERIC_SET_TO_NEEDED();
 
-                    local_radix = PL_numeric_underlying && PL_numeric_radix_sv;
+                    local_radix = _NOT_IN_NUMERIC_STANDARD;
                     if (local_radix && SvCUR(PL_numeric_radix_sv) > 1) {
                         size += SvCUR(PL_numeric_radix_sv) - 1;
                         s = SvGROW_mutable(sv, size);