From 776672d104571bd103dccf8bf9a82447fde254a4 Mon Sep 17 00:00:00 2001 From: Heuzef Date: Fri, 25 Oct 2019 16:46:31 +0200 Subject: [PATCH] Remove useless condition --- Check.pm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Check.pm b/Check.pm index 9c5936e..ae6e652 100644 --- a/Check.pm +++ b/Check.pm @@ -85,14 +85,12 @@ sub action my $new_size_q3 = 0; my $sizes = new Statistics::Descriptive::Full; - if ( scalar( @Backups ) ){ - foreach my $backup ( @Backups ) { - # Skip partial or active backups - next if ( $backup->{type} !~ m/^full|incr$/ ); - # Push all the sizes in our data set to compute avg sizes - # Exclude backup N°0 as it'll always have much more new data than normal backups - $sizes->add_data($backup->{sizeNew}) unless ( $backup->{num} == 0 ); - } + foreach my $backup ( @Backups ) { + # Skip partial or active backups + next if ( $backup->{type} !~ m/^full|incr$/ ); + # Push all the sizes in our data set to compute avg sizes + # Exclude backup N°0 as it'll always have much more new data than normal backups + $sizes->add_data($backup->{sizeNew}) unless ( $backup->{num} == 0 ); # Ignore the last backup if it's not full or incr (which means it's either partial or active) my $i = ( $Backups[-1]->{type} =~ m/^full|incr$/ ) ? -1 : -2;