Commit 808ec8a3 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

add limit option to limit number of returned results

parent 60e27add
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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;