summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/index.pl b/index.pl
index d05ca7c..3e6332f 100644
--- a/index.pl
+++ b/index.pl
@@ -518,6 +518,10 @@ sub handle_request {
@results = grep { result_has_train_type( $_, @train_types ) } @results;
}
+ if ( $limit and $limit =~ m{ ^ \d+ $ }x ) {
+ splice( @results, $limit );
+ }
+
for my $result (@results) {
my $platform = ( split( qr{ }, $result->platform // '' ) )[0];
my $delay = $result->delay;