Skip to content

Commit

Permalink
refactor: better chomp when defined
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bougard committed Jan 29, 2019
1 parent 4a08e14 commit cfe3baf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/FusionInventory/Agent/Tools.pm
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ sub getFirstLine {
my $result = <$handle>;
close $handle;

chomp $result if $result;
chomp $result if defined $result;
return $result;
}

Expand All @@ -371,7 +371,7 @@ sub getLastLine {
}
close $handle;

chomp $result if $result;
chomp $result if defined $result;
return $result;
}

Expand Down Expand Up @@ -829,4 +829,4 @@ Return the content of a given file.
=head2 isParamArrayAndFilled($hash, $paramName)
Return if $hash has a key $paramName which value is a ARRAY ref not empty.
Return if $hash has a key $paramName which value is a ARRAY ref not empty.

0 comments on commit cfe3baf

Please sign in to comment.