Commits

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

Eliminated the use of top.

  • Participants
  • Parent commits 5fb2d9f

Comments (0)

Files changed (2)

File lib/File/Find/Object.pm

     return $self->{_curr_file};
 }
 
-sub _top
-{
-    my $self = shift;
-    if (defined($self->{_top}))
-    {
-        return $self->{_top};
-    }
-    else
-    {
-        return $self;
-    }
-}
-
 sub DESTROY {
     my ($self) = @_;
 #    print STDERR join(" ", caller)."\n";
             
         if ($_ eq 'b') {
             $self->check_subdir($current) or next;
-            push @{$self->_dir_stack()}, File::Find::Object::internal->new($current, scalar(@{$self->_dir_stack()}));
+            push @{$self->_dir_stack()}, 
+                File::Find::Object::internal->new(
+                    $self,
+                    $current, 
+                    scalar(@{$self->_dir_stack()})
+                );
             return 0;
         }
     }
     {
         return 0;
     }
-    if (-l $self->current_path($current) && !$current->_top->{followlink})
+    if (-l $self->current_path($current) && !$self->{followlink})
     {
         return 0;
     }
-    if ($st[0] != $self->_father($current)->{dev} && $current->_top->{nocrossfs})
+    if ($st[0] != $self->_father($current)->{dev} && $self->{nocrossfs})
     {
         return 0;
     }

File lib/File/Find/Object/internal.pm

 use File::Spec;
 
 sub new {
-    my ($class, $from, $index) = @_;
-
-    my $top = $from->_top;
+    my ($class, $top, $from, $index) = @_;
 
     my $self = {
-        _top => $top,
         dir => $top->current_path($from),
         idx => $index,
     };