From 11ddb2789dd7af17b2085de2f7c791173ef2a320 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Sun, 8 Feb 2015 16:11:44 +0200 Subject: [PATCH] Don't check mkrun_runner arguments for definedness twice --- lib/Gruntmaster/Daemon/Runner/File.pm | 2 +- lib/Gruntmaster/Daemon/Runner/Interactive.pm | 4 ++-- lib/Gruntmaster/Daemon/Runner/Verifier.pm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Gruntmaster/Daemon/Runner/File.pm b/lib/Gruntmaster/Daemon/Runner/File.pm index 1a4829a..4276858 100644 --- a/lib/Gruntmaster/Daemon/Runner/File.pm +++ b/lib/Gruntmaster/Daemon/Runner/File.pm @@ -16,7 +16,7 @@ our $VERSION = '5999.000_004'; sub run{ my ($test, $meta) = @_; get_logger->trace("Running on test $test..."); - $meta->{files}{prog}{run}->($meta->{files}{prog}{name}, fds => [qw/0 input 1 >output/], map {defined $meta->{$_} ? ($_ => $meta->{$_}) : () } qw/timeout olimit mlimit/); + $meta->{files}{prog}{run}->($meta->{files}{prog}{name}, fds => [qw/0 input 1 >output/], map { $_ => $meta->{$_} } qw/timeout olimit mlimit/); my $out = slurp 'output'; my $ok; if (exists $meta->{okfile}) { # uncoverable branch false diff --git a/lib/Gruntmaster/Daemon/Runner/Interactive.pm b/lib/Gruntmaster/Daemon/Runner/Interactive.pm index dfdf95b..f87e88c 100644 --- a/lib/Gruntmaster/Daemon/Runner/Interactive.pm +++ b/lib/Gruntmaster/Daemon/Runner/Interactive.pm @@ -30,7 +30,7 @@ sub run{ if ($ret) { try { my @fds = $ENV{GRUNTMASTER_VM} ? qw,0 /dev/ttyS1 1 >/dev/ttyS1, : qw/0 fifo1 1 >fifo2/; - $meta->{files}{prog}{run}->($meta->{files}{prog}{name}, fds => \@fds, map {defined $meta->{$_} ? ($_ => $meta->{$_}) : () } qw/timeout mlimit/); + $meta->{files}{prog}{run}->($meta->{files}{prog}{name}, fds => \@fds, map { $_ => $meta->{$_} } qw/timeout mlimit/); } catch { die $_ ## no critic (RequireCarping) } finally { @@ -40,7 +40,7 @@ sub run{ } else { try { my @fds = $ENV{GRUNTMASTER_VM} ? qw,1 >/dev/ttyS1 0 /dev/ttyS1, : qw/1 >fifo1 0 fifo2/; - $meta->{files}{ver}{run}->($meta->{files}{ver}{name}, fds => [@fds, qw,4 >result,], args => [$test], map {defined $meta->{$_} ? ($_ => $meta->{$_}) : () } qw/timeout mlimit/); + $meta->{files}{ver}{run}->($meta->{files}{ver}{name}, fds => [@fds, qw,4 >result,], args => [$test], map { $_ => $meta->{$_} } qw/timeout mlimit/); } catch { exit 1; }; diff --git a/lib/Gruntmaster/Daemon/Runner/Verifier.pm b/lib/Gruntmaster/Daemon/Runner/Verifier.pm index 7111f6b..463fd71 100644 --- a/lib/Gruntmaster/Daemon/Runner/Verifier.pm +++ b/lib/Gruntmaster/Daemon/Runner/Verifier.pm @@ -16,7 +16,7 @@ our $VERSION = '5999.000_004'; sub run{ my ($test, $meta) = @_; get_logger->trace("Running on test $test..."); - $meta->{files}{prog}{run}->($meta->{files}{prog}{name}, fds => [qw/0 input 1 >output/], map {defined $meta->{$_} ? ($_ => $meta->{$_}) : () } qw/timeout olimit mlimit/); + $meta->{files}{prog}{run}->($meta->{files}{prog}{name}, fds => [qw/0 input 1 >output/], map { $_ => $meta->{$_} } qw/timeout olimit mlimit/); try { $meta->{files}{ver}{run}->($meta->{files}{ver}{name}, fds => [qw/0 input 3 output 1 >result/], args => [$test]); -- 2.39.2