Anonymous avatar Anonymous committed a3611f7

Optimized the nocrossfs() part.

Comments (0)

Files changed (2)

     was no longer used and needed.
     - Optimization: instead of calling File::Find::Object::Result->new()
     just bless to it.
+    - Optimization: now caching the filesystem device at
+    the top for nocrossfs().
+        - Plus: rearranged the order of the checks in
+        _non_top__check_subdir_helper
 
 0.1.7 - Thu Jan 15 16:09:49 IST 2009
     - Fixed the check-for-link and for directory semantics on Windows

lib/File/Find/Object.pm

             $top->_fill_actions($self);
             $top->_mystat();
             $self->_stat_ret($top->_top_stat_copy());
+            $top->_dev($self->_dev);
             return 1;
         }
     }
             _current
             _curr_path
             _def_actions
+            _dev
             _dir_stack
             item_obj
             _target_index
 sub _non_top__check_subdir_helper {
     my $self = shift;
 
-    if ($self->_top_is_link() && !$self->followlink())
+    if (!$self->followlink() && $self->_top_is_link())
     {
         return 0;
     }
 
-    if (   $self->_top_stat->[0] != $self->_current_father->_dev()
-        && $self->nocrossfs()
+    if ($self->nocrossfs() 
+        && $self->_top_stat->[0] != $self->_dev()
     )
     {
         return 0;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.