summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-03-03 19:15:07 -0700
committerKarl Williamson <khw@cpan.org>2018-03-03 19:55:58 -0700
commit3c76a41273291359254beddc38dcf4f68f72934c (patch)
treebd03d5bd267ffd19b0d357e60bed4282fc1e7539 /locale.c
parent8773126a5a3f0a35e4c429218a51b1af4aefb1c7 (diff)
downloadperl-3c76a41273291359254beddc38dcf4f68f72934c.tar.gz
locale.c: Replace an 'if' by an assert
This should be true if we get to here.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/locale.c b/locale.c
index 7192916c67..9970ae6e67 100644
--- a/locale.c
+++ b/locale.c
@@ -943,6 +943,7 @@ S_emulate_setlocale(const int category,
/* Find the index of the category name in our lists */
for (i = 0; i < LC_ALL_INDEX; i++) {
+ char * individ_locale;
/* Keep going if this isn't the index. The strnNE() avoids a
* Perl_form(), but would fail if ever a category name could be
@@ -961,10 +962,9 @@ S_emulate_setlocale(const int category,
goto ready_to_set;
}
- if (category == LC_ALL) {
- char * individ_locale = Perl_form(aTHX_ "%.*s", (int) (p - s), s);
- emulate_setlocale(categories[i], individ_locale, i, TRUE);
- }
+ assert(category == LC_ALL);
+ individ_locale = Perl_form(aTHX_ "%.*s", (int) (p - s), s);
+ emulate_setlocale(categories[i], individ_locale, i, TRUE);
}
s = p;