Skip to content

Commit 9e67fa1

Browse files
khwilliamsonLeont
authored andcommitted
vutil.c: Reverse order of conditional cpp
It's easier to read to get the trivial case out of the way first.
1 parent 2591369 commit 9e67fa1

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

vutil/vutil.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -646,13 +646,19 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
646646
* locales without letting perl know, therefore we have to find it
647647
* from first principals. See [perl #121930]. */
648648

649-
/* In windows, or not threaded, or not thread-safe, if it isn't C,
650-
* set it to C. */
651-
652-
# ifndef USE_POSIX_2008_LOCALE
649+
# ifdef USE_POSIX_2008_LOCALE
653650

651+
/* With POSIX 2008, all we have to do is toggle to the C locale
652+
* just long enough to get the value (which should have a dot). */
653+
const locale_t locale_obj_on_entry = uselocale(PL_C_locale_obj);
654+
GET_NUMERIC_VERSION(ver, sv, tbuf, buf, len);
655+
uselocale(locale_obj_on_entry);
656+
# else
654657
const char * locale_name_on_entry;
655658

659+
/* In windows, or not threaded, or not thread-safe, if it isn't C,
660+
* set it to C. */
661+
656662
LC_NUMERIC_LOCK(0); /* Start critical section */
657663

658664
locale_name_on_entry = setlocale(LC_NUMERIC, NULL);
@@ -681,13 +687,6 @@ Perl_upg_version(pTHX_ SV *ver, bool qv)
681687
}
682688

683689
LC_NUMERIC_UNLOCK; /* End critical section */
684-
685-
# else
686-
/* With POSIX 2008, all we have to do is toggle to the C locale
687-
* just long enough to get the value (which should have a dot). */
688-
const locale_t locale_obj_on_entry = uselocale(PL_C_locale_obj);
689-
GET_NUMERIC_VERSION(ver, sv, tbuf, buf, len);
690-
uselocale(locale_obj_on_entry);
691690
# endif
692691

693692
}

0 commit comments

Comments
 (0)