Commits

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

_top_it cleanup.

- Optimization/Refactoring: made the _top_it method names saner,
and removed an unused one.

  • Participants
  • Parent commits a3611f7

Comments (0)

Files changed (2)

     the top for nocrossfs().
         - Plus: rearranged the order of the checks in
         _non_top__check_subdir_helper
+    - Optimization/Refactoring: made the _top_it method names saner,
+    and removed an unused one.
 
 0.1.7 - Thu Jan 15 16:09:49 IST 2009
     - Fixed the check-for-link and for directory semantics on Windows

File lib/File/Find/Object.pm

 # and the other if it's false.
 #
 # This has been a common pattern in the code and should be eliminated.
+#
+# _d is the deep method.
+# and _t is the top one.
 
 sub _top_it
 {
         *{$pkg."::".$method} =
             do {
                 my $m = $method;
-                my $top = "_top_$m";
-                my $non = "_non_top_$m";
+                my $t = $m . "_t";
+                my $d = $m . "_d";
                 sub {
                     my $self = shift;
                     return exists($self->{_st})
-                        ? $self->$non(@_)
-                        : $self->$top(@_)
+                        ? $self->$d(@_)
+                        : $self->$t(@_)
                         ;
                 };
             };
 
 __PACKAGE__->_top_it([qw(
     _check_subdir_helper
-    _father_components
     _me_die
     )]
 );
     return $self->_current()->_move_next($self);
 }
 
-sub _top__me_die {
+sub _me_die_t {
     return 1;
 }
 
-sub _non_top__me_die {
+sub _me_die_d {
     my $self = shift;
 
     return $self->_become_default();
     }
 }
 
-sub _top__check_subdir_helper {
+sub _check_subdir_helper_t {
     return 1;
 }
 
     return;
 }
 
-sub _non_top__check_subdir_helper {
+sub _check_subdir_helper_d {
     my $self = shift;
 
     if (!$self->followlink() && $self->_top_is_link())