From 5b1f18a75ba6ee80f801b8f8226103f1495701fa Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 24 Feb 2014 11:56:47 -0700 Subject: lib/locale.t: Change an array to a hash This is more naturally a hash in that it is a list of numbers, not necessarily consecutive, and each time through the loop the same number was getting pushed, so had multiple entries for each by the time it was finished. --- lib/locale.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/locale.t') diff --git a/lib/locale.t b/lib/locale.t index 42dde69fdb..ae92eec8f4 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -41,7 +41,7 @@ my $acceptable_fold_failure_percentage = ($^O =~ / ^ ( MSWin32 | AIX ) $ /ix) : 5; # The list of test numbers of the problematic tests. -my @problematical_tests; +my %problematical_tests; use Dumpvalue; @@ -1342,7 +1342,7 @@ foreach my $Locale (@Locale) { report_multi_result($Locale, $locales_test_number, \@f); foreach ($first_casing_test_number..$locales_test_number) { - push @problematical_tests, $_; + $problematical_tests{$_} = 1; } @@ -1841,7 +1841,7 @@ foreach my $Locale (@Locale) { } } report_multi_result($Locale, $locales_test_number, \@f); - push @problematical_tests, $locales_test_number; + $problematical_tests{$locales_test_number} = 1; } # [perl #109318] @@ -1894,7 +1894,7 @@ foreach $test_num ($first_locales_test_number..$final_locales_test_number) { print "# It usually indicates a problem in the environment,\n"; print "# not in Perl itself.\n"; } - if ($Okay{$test_num} && grep { $_ == $test_num } @problematical_tests) { + if ($Okay{$test_num} && grep { $_ == $test_num } keys %problematical_tests) { no warnings 'experimental::autoderef'; # Round to nearest .1% my $percent_fail = (int(.5 + (1000 * scalar(keys $Problem{$test_num}) -- cgit v1.2.1