summaryrefslogtreecommitdiff
path: root/cgi
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-02-13 21:10:26 +0100
committerDaniel Friesel <derf@finalrewind.org>2013-02-13 21:10:26 +0100
commiteaae6e31e78eb05f05488db7c7f78d46142549c3 (patch)
tree6b3379411c392b54da7e6dbfc1a3abc67b8a0249 /cgi
parent00d2c8eac5bcf13579c75fa4a5ccfd117b4d2adf (diff)
use any instead of boolean grep
Diffstat (limited to 'cgi')
-rw-r--r--cgi/index.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/cgi/index.pl b/cgi/index.pl
index 06eb677..1a88a29 100644
--- a/cgi/index.pl
+++ b/cgi/index.pl
@@ -1,6 +1,7 @@
#!/usr/bin/env perl
use Mojolicious::Lite;
use Cache::File;
+use List::MoreUtils qw(any);
use Travel::Status::DE::DeutscheBahn;
use 5.014;
use utf8;
@@ -76,11 +77,11 @@ sub handle_request {
my $platform = ( split( / /, $result->platform ) )[0];
if ($via) {
my @route = $result->route;
- if ( not( grep { $_ =~ m{$via}io } @route ) ) {
+ if ( not( any { $_ =~ m{$via}io } @route ) ) {
next;
}
}
- if ( @platforms and not grep { $_ eq $platform } @platforms ) {
+ if ( @platforms and not( any { $_ eq $platform } @platforms ) ) {
next;
}
my $info = $result->info;