Commits

shl...@6f433eb9-a002-0410-945b-ee5462c261ee  committed b9e04b3

Removed an explicit tracking of _current_idx - it's just $#dir_stack.

  • Participants
  • Parent commits 9c8246d

Comments (0)

Files changed (1)

File lib/File/Find/Object.pm

 use base 'File::Find::Object::Base';
 
 __PACKAGE__->mk_accessors(qw(
-    _current_idx
     _dir_stack
     item
     _targets
     }
     $tree->_targets([ @targets ]);
     $tree->_target_index(-1);
-    $tree->_current_idx(-1);
     $tree->_reset_actions();
 
     $tree->_last_dir_scanned(undef);
     return ($self->_current_idx() < 0);
 }
 
+sub _current_idx
+{
+    my $self = shift;
+
+    return $#{$self->_dir_stack()};
+}
+
 sub _current_path
 {
     my $self = shift;
     if ($self eq $father)
     {
         @{$self->_dir_stack()} = ();
-        $self->_current_idx(-1);
     }
     else
     {
     my $self = shift;
 
     pop(@{$self->_dir_stack()});
-    $self->_dec_current_idx();
 
     return;
 }
             scalar(@{$self->_dir_stack()})
         );
 
-    $self->_inc_current_idx();
-
     return 0;
 }