aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xstats.pl5
1 files changed, 2 insertions, 3 deletions
diff --git a/stats.pl b/stats.pl
index b8dde83..a1a8d88 100755
--- a/stats.pl
+++ b/stats.pl
@@ -24,9 +24,8 @@ sub in_array {
my $str = shift;
my $arr = shift;
- for my $val (@{$arr}) {
- return 1 if ($str eq $val);
- }
+ my %a = map { $_ => 1 } @{$arr};
+ return 1 if (exists $a{$str});
return 0;
}