diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-01-24 14:53:07 +1100 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-01-26 17:00:02 -0800 |
commit | 762dbb61c0deabc7fc6fdf379fa8a8e3d5fe044d (patch) | |
tree | 95570908d1f3b9ce00b92040612a5dfcdcf5827b /lib | |
parent | 1fd526a571ef2ecb638bfb3b620e5b13f07c4504 (diff) | |
download | vyatta-cfg-762dbb61c0deabc7fc6fdf379fa8a8e3d5fe044d.tar.gz vyatta-cfg-762dbb61c0deabc7fc6fdf379fa8a8e3d5fe044d.zip |
DOMTree: Fix perlcritic warnings
Get rid of these:
"return" statement with explicit "undef" at line 333, column 27. See page 199 of PBP. (Severity: 5)
"return" statement with explicit "undef" at line 335, column 35. See page 199 of PBP. (Severity: 5)
"return" statement with explicit "undef" at line 366, column 2. See page 199 of PBP. (Severity: 5)
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/Vyatta/ConfigDOMTree.pm | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Vyatta/ConfigDOMTree.pm b/lib/Vyatta/ConfigDOMTree.pm index 865f17b..d6f1ebe 100755 --- a/lib/Vyatta/ConfigDOMTree.pm +++ b/lib/Vyatta/ConfigDOMTree.pm @@ -330,11 +330,11 @@ sub _construct_dom_tree { my $subnodesNum=0; my $valuePresent=0; - if(!(defined $self)) {return undef;} + return unless defined $self; - opendir DIR, $self->{_dir} or return undef; - my @entries = grep !/^\./, readdir DIR; - closedir DIR; + opendir my $dir, $self->{_dir} or return; + my @entries = grep !/^\./, readdir $dir; + closedir $dir; while(@entries) { @@ -362,9 +362,7 @@ sub _construct_dom_tree { } } - if($valuePresent<1 && $subnodesNum<1) { - return undef; - } + return if ( $valuePresent < 1 && $subnodesNum < 1 ); return $self; } |