Skip to content

Commit

Permalink
no need to check first
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 23, 2016
1 parent eac8210 commit 170810d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/Mojo/Util.pm
Expand Up @@ -116,12 +116,9 @@ sub encode { _encoding($_[0])->encode("$_[1]") }

sub files {
my $dir = shift;

my @files;
return @files unless -d $dir;
my $wanted = sub { -d $File::Find::name or push @files, $File::Find::name };
find {wanted => $wanted, no_chdir => 1}, $dir;

find {wanted => $wanted, no_chdir => 1}, $dir if -d $dir;
return sort @files;
}

Expand Down

0 comments on commit 170810d

Please sign in to comment.