From: Nigel McNie Date: Thu, 12 Jun 2008 00:03:03 +0000 (+1200) Subject: Some refactoring I missed, as pointed out by Martyn. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5d3197190906890636c61069885f9240d2816f32;p=tks.git Some refactoring I missed, as pointed out by Martyn. --- diff --git a/tks.pl b/tks.pl index 6ed5c57..c1a7eb3 100755 --- a/tks.pl +++ b/tks.pl @@ -165,14 +165,12 @@ sub load_timesheet_file { } foreach my $date ( keys %{$result} ) { - my $found_error = 0; if ( my @errors = grep { $_->{needs_closing_time} } @{$result->{$date}} ) { - $found_error = 1; foreach my $error ( @errors ) { print "Error on line ", $error->{linenumber}, ": no closing time found\n"; } + exit 1; } - exit 1 if $found_error; } return $result;