locale.t: Don't test a locale twice
authorKarl Williamson <public@khwilliamson.com>
Mon, 16 Jan 2012 00:10:35 +0000 (17:10 -0700)
committerKarl Williamson <public@khwilliamson.com>
Sat, 21 Jan 2012 17:02:52 +0000 (10:02 -0700)
Don't add it to the list if already there.

lib/locale.t

index d181f25..99b3a15 100644 (file)
@@ -346,6 +346,7 @@ sub getalnum_ {
 
 sub trylocale {
     my $locale = shift;
+    return if grep { $locale eq $_ } @Locale;
     if (setlocale(LC_ALL, $locale)) {
        push @Locale, $locale;
     }