Skip to content

Commit

Permalink
t/loc_tools.pl: Fail earlier
Browse files Browse the repository at this point in the history
Move the code that returns failure into the loop, so won't keep
iterating if failure is going to happen anyway.
  • Loading branch information
khwilliamson committed May 5, 2021
1 parent b185acb commit d45f941
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions t/loc_tools.pl
Expand Up @@ -175,14 +175,18 @@ ($$$$)

my $result = setlocale($category, $locale);
return unless defined $result;
}

if ($badutf8) {
_my_fail("Verify locale name doesn't contain malformed utf8");
return;
no locale;

if ($badutf8) {
_my_fail("Verify locale name doesn't contain malformed utf8");
return;
}

return unless $plays_well || $allow_incompatible;
}

push @$list, $locale if $plays_well || $allow_incompatible;
push @$list, $locale;
}

sub _decode_encodings { # For use only by other functions in this file!
Expand Down

0 comments on commit d45f941

Please sign in to comment.