diff options
author | Karl Williamson <khw@cpan.org> | 2018-03-03 19:15:07 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-03-03 19:55:58 -0700 |
commit | 3c76a41273291359254beddc38dcf4f68f72934c (patch) | |
tree | bd03d5bd267ffd19b0d357e60bed4282fc1e7539 /locale.c | |
parent | 8773126a5a3f0a35e4c429218a51b1af4aefb1c7 (diff) | |
download | perl-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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; |