aboutsummaryrefslogtreecommitdiffstats
path: root/stats.pl
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2015-02-14 10:48:23 +0100
committerMarius Halden <marius.h@lden.org>2015-02-14 10:48:23 +0100
commit3c5b984bf15ada95f7d86172f9aafef43494a922 (patch)
tree0004407b04390c26f91b38e05b6e3b6b52b73a51 /stats.pl
parentd70a993a357c3dc7eb33e8a84b202dd338f02f0d (diff)
downloadappdrift-stats-logger.tar.gz
appdrift-stats-logger.tar.bz2
appdrift-stats-logger.tar.xz
Simplify in_array functionlogger
Diffstat (limited to 'stats.pl')
-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;
}