From 456b79fb2169c01654fd07b4b7d72ca33938b439 Mon Sep 17 00:00:00 2001 From: Jens Luedicke Date: Sat, 9 Mar 2013 21:00:38 +0100 Subject: [PATCH] M: Replaced two nested if blocks with one. --- lib/File/DirWalk.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/File/DirWalk.pm b/lib/File/DirWalk.pm index 266abeb..b4be405 100644 --- a/lib/File/DirWalk.pm +++ b/lib/File/DirWalk.pm @@ -151,10 +151,8 @@ sub walk { } elsif (-d $path) { - if ($self->{depth} != 0) { - if ($self->{currentDepth} == $self->{depth}) { - return SUCCESS; - } + if (($self->{depth} > 0) and ($self->{currentDepth} == $self->{depth})) { + return SUCCESS; } opendir (my $dirh, $path) || return FAILED;