Permalink
Browse files

code cleanup derp

  • Loading branch information...
1 parent 6f008b7 commit 8a9daae5bcef9d4cda5cdf6b3cc61f30068c179e @derf committed Aug 14, 2012
Showing with 14 additions and 14 deletions.
  1. +14 −14 cgi/index.pl
View
@@ -30,14 +30,14 @@ sub handle_request {
my $station = $self->stash('station');
my $via = $self->stash('via');
- my @platforms = split(/,/, $self->param('platforms') // q{});
+ my @platforms = split( /,/, $self->param('platforms') // q{} );
my $template = $self->param('mode') // 'multi';
$self->stash( departures => [] );
$self->stash( title => 'db-fakedisplay' );
$self->stash( version => $VERSION );
- if (not($template ~~ [qw[multi single]])) {
+ if ( not( $template ~~ [qw[multi single]] ) ) {
$template = 'multi';
}
@@ -54,29 +54,29 @@ sub handle_request {
return;
}
- if ($template eq 'single') {
- if (not @platforms) {
+ if ( $template eq 'single' ) {
+ if ( not @platforms ) {
for my $result (@results) {
- if (not ($result->platform ~~ \@platforms)) {
- push(@platforms, $result->platform);
+ if ( not( $result->platform ~~ \@platforms ) ) {
+ push( @platforms, $result->platform );
}
}
@platforms = sort { $a <=> $b } @platforms;
}
my %pcnt;
- @results = grep { $pcnt{$_->platform}++ < 1 } @results;
+ @results = grep { $pcnt{ $_->platform }++ < 1 } @results;
@results = sort { $a->platform <=> $b->platform } @results;
}
for my $result (@results) {
my $platform = ( split( / /, $result->platform ) )[0];
if ($via) {
my @route = $result->route;
- if (not( grep { $_ =~ m{$via}io } @route )) {
+ if ( not( grep { $_ =~ m{$via}io } @route ) ) {
next;
}
}
- if (@platforms and not grep { $_ eq $platform } @platforms) {
+ if ( @platforms and not grep { $_ eq $platform } @platforms ) {
next;
}
push(
@@ -110,10 +110,10 @@ sub handle_request {
$params->remove('via');
for my $param (qw(platforms)) {
- if (not $params->param($param)) {
+ if ( not $params->param($param) ) {
$params->remove($param);
}
- elsif ($param eq 'mode' and $params->param($param) eq 'multi') {
+ elsif ( $param eq 'mode' and $params->param($param) eq 'multi' ) {
$params->remove($param);
}
}
@@ -137,10 +137,10 @@ sub handle_request {
app->config(
hypnotoad => {
- accepts => 10,
- listen => ['http://*:8092'],
+ accepts => 10,
+ listen => ['http://*:8092'],
pid_file => '/tmp/db-fake.pid',
- workers => 2,
+ workers => 2,
},
);

0 comments on commit 8a9daae

Please sign in to comment.