Commits

Anonymous committed 25b0033

Another small optimization.

Comments (0)

Files changed (2)

     in Class::Accessor. Hopefully, this will make F-F-O run faster.
     - A small optimization - added a flag to $self with whether the stack
     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.
 
 0.1.5 - Sat Jan  3 17:17:31 IST 2009
     - Unified the two calls to stat() (and several calls to other file

lib/File/Find/Object.pm

 
 __PACKAGE__->_top_it([qw(
     _check_subdir_helper
-    _current
     _father_components
     _me_die
     )]
 #    printf STDERR "destroy `%s'\n", $self->_dir_as_string || "--";
 #}
 
-sub _top__current
+sub _current
 {
     my $self = shift;
 
-    return $self;
-}
-
-sub _non_top__current
-{
-    my $self = shift;
-
-    return $self->_dir_stack->[-1];
+    return $self->_dir_stack->[-1] || $self;
 }
 
 sub _is_top