Commits

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

Eliminated _current_components_copy.

  • Participants
  • Parent commits 25b0033
  • Branches experimental-optimizations-1

Comments (0)

Files changed (2)

     is full or not. This is used inside _top_it() and _is_top().
     - A small optimization - implemented _current directly instead of
     a _top / _non_top version - saved 2.5 seconds of runtime.
+    - A small optimization - got rid of _current_components_copy() (which
+    was useless because _current_components already returns a dynamic
+    reference) and replaced all calls with calls to _current_components().
 
 0.1.5 - Sat Jan  3 17:17:31 IST 2009
     - Unified the two calls to stat() (and several calls to other file

File lib/File/Find/Object.pm

     my $self = {};
     bless $self, $class;
 
-    $self->_dir($top->_current_components_copy());
+    $self->_dir($top->_current_components());
     $self->_stat_ret($top->_top_stat_copy());
 
     $self->idx($index);
 );
 
 __PACKAGE__->_make_copy_methods([qw(
-    _current_components
     _top_stat
     )]
 );
 {
     my $self = shift;
 
-    return File::Spec->catfile(@{$self->_current_components_copy()});
+    return File::Spec->catfile(@{$self->_current_components()});
 }
 
 sub _calc_current_item_obj {
     my $self = shift;
 
-    my $components = $self->_current_components_copy();
+    my $components = $self->_current_components();
     my $base = shift(@$components);
     my $stat = $self->_top_stat_copy();
 
 {
     my $self = shift;
 
-    $self->_current->_dir($self->_current_components_copy());
+    $self->_current->_dir($self->_current_components());
 
     # _open_dir can return undef if $self->_current is not a directory.
     if ($self->_open_dir())