Commits

Anonymous committed 12384af

Refactoring - _open_dir now calculates its own _current().

  • Participants
  • Parent commits 4c59516

Comments (0)

Files changed (1)

lib/File/Find/Object.pm

 
     $self->_reset_actions();
 
-    return $top->_open_dir($top->_father($self)) ? $self : undef;
+    return $top->_open_dir() ? $self : undef;
 }
 
 package File::Find::Object;
 }
 
 sub _open_dir {
-    my ($self, $current) = @_;
+    my $self = shift;
+
+    my $current = $self->_current();
 
     if (defined($current->_last_dir_scanned()) &&
         ($current->_last_dir_scanned() eq $current->dir()
     $self->_current->dir($self->_current_path());
 
     # _open_dir can return undef if $self->_current is not a directory.
-    if ($self->_open_dir($self->_current))
+    if ($self->_open_dir())
     {
         return [ @{$self->_current->_files()}];
     }