Skip to content

Commit 2c8e798

Browse files
committed
sv.c: Move some code; consolidate
This moves the code for cloning the locale variables to a single place, consolidating some that had the same cpp directives. It showed that one variable was cloned twice; the redundant one is now removed.
1 parent 9748957 commit 2c8e798

File tree

1 file changed

+18
-25
lines changed

1 file changed

+18
-25
lines changed

sv.c

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15584,30 +15584,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
1558415584
PL_subline = proto_perl->Isubline;
1558515585

1558615586
PL_cv_has_eval = proto_perl->Icv_has_eval;
15587-
15588-
#ifdef USE_LOCALE_COLLATE
15589-
PL_collation_ix = proto_perl->Icollation_ix;
15590-
PL_collation_standard = proto_perl->Icollation_standard;
15591-
PL_collxfrm_base = proto_perl->Icollxfrm_base;
15592-
PL_collxfrm_mult = proto_perl->Icollxfrm_mult;
15593-
PL_strxfrm_max_cp = proto_perl->Istrxfrm_max_cp;
15594-
PL_strxfrm_is_behaved = proto_perl->Istrxfrm_is_behaved;
15595-
PL_strxfrm_NUL_replacement = proto_perl->Istrxfrm_NUL_replacement;
15596-
#endif /* USE_LOCALE_COLLATE */
15597-
15598-
#ifdef USE_LOCALE_NUMERIC
15599-
PL_numeric_standard = proto_perl->Inumeric_standard;
15600-
PL_numeric_underlying = proto_perl->Inumeric_underlying;
15601-
PL_numeric_underlying_is_standard = proto_perl->Inumeric_underlying_is_standard;
15602-
#endif /* !USE_LOCALE_NUMERIC */
15603-
15604-
/* Did the locale setup indicate UTF-8? */
15605-
PL_utf8locale = proto_perl->Iutf8locale;
15606-
15607-
#ifdef USE_LOCALE_THREADS
15608-
assert(PL_locale_mutex_depth <= 0);
15609-
PL_locale_mutex_depth = 0;
15610-
#endif
1561115587
/* Unicode features (see perlrun/-C) */
1561215588
PL_unicode = proto_perl->Iunicode;
1561315589

@@ -15920,20 +15896,37 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
1592015896
/* Should we warn if uses locale? */
1592115897
PL_ctype_name = SAVEPV(proto_perl->Ictype_name);
1592215898
PL_warn_locale = sv_dup_inc(proto_perl->Iwarn_locale, param);
15923-
PL_utf8locale = proto_perl->Iutf8locale;
1592415899
PL_in_utf8_CTYPE_locale = proto_perl->Iin_utf8_CTYPE_locale;
1592515900
PL_in_utf8_turkic_locale = proto_perl->Iin_utf8_turkic_locale;
1592615901
#endif
1592715902

15903+
/* Did the locale setup indicate UTF-8? */
15904+
PL_utf8locale = proto_perl->Iutf8locale;
15905+
1592815906
#ifdef USE_LOCALE_COLLATE
1592915907
PL_in_utf8_COLLATE_locale = proto_perl->Iin_utf8_COLLATE_locale;
1593015908
PL_collation_name = SAVEPV(proto_perl->Icollation_name);
15909+
PL_collation_ix = proto_perl->Icollation_ix;
15910+
PL_collation_standard = proto_perl->Icollation_standard;
15911+
PL_collxfrm_base = proto_perl->Icollxfrm_base;
15912+
PL_collxfrm_mult = proto_perl->Icollxfrm_mult;
15913+
PL_strxfrm_max_cp = proto_perl->Istrxfrm_max_cp;
15914+
PL_strxfrm_is_behaved = proto_perl->Istrxfrm_is_behaved;
15915+
PL_strxfrm_NUL_replacement = proto_perl->Istrxfrm_NUL_replacement;
1593115916
#endif /* USE_LOCALE_COLLATE */
1593215917

15918+
#ifdef USE_LOCALE_THREADS
15919+
assert(PL_locale_mutex_depth <= 0);
15920+
PL_locale_mutex_depth = 0;
15921+
#endif
15922+
1593315923
#ifdef USE_LOCALE_NUMERIC
1593415924
PL_numeric_name = SAVEPV(proto_perl->Inumeric_name);
1593515925
PL_numeric_radix_sv = sv_dup_inc(proto_perl->Inumeric_radix_sv, param);
1593615926
PL_underlying_radix_sv = sv_dup_inc(proto_perl->Iunderlying_radix_sv, param);
15927+
PL_numeric_standard = proto_perl->Inumeric_standard;
15928+
PL_numeric_underlying = proto_perl->Inumeric_underlying;
15929+
PL_numeric_underlying_is_standard = proto_perl->Inumeric_underlying_is_standard;
1593715930

1593815931
# if defined(USE_POSIX_2008_LOCALE)
1593915932
PL_underlying_numeric_obj = NULL;

0 commit comments

Comments
 (0)