Commits

Anonymous committed b70cc33

Optimized _set_inodes() in ::DeepPath.

Comments (0)

Files changed (2)

     - Optimization: replaced the _top_it() of _me_die() with a normal method
     with a conditional, as it was the only place where _top_it() was still
     used.
+    - Optimization/Cleanup: _set_inodes() in ::DeepPath. 
 
 0.1.8 - Mon Jan 19 18:36:51 IST 2009
     - Optimization/Refactoring: replaced the last call to ->_father with a 

lib/File/Find/Object.pm

     $self->_dir([ @{$top->_curr_comps()} ]);
     $self->_stat_ret($top->_top_stat_copy());
 
-    my $inode = $self->_inode();
-    $self->_set_inodes(
-        {
-            %{$from->_inodes()},
-            (
-                ($inode == 0)
-                ? ()
-                : (join(",", $self->_dev(), $inode)
-                    =>
-                    scalar(@{$top->_dir_stack()})
-                  )
-            )
-        }
-    );
+    my $find = { %{$from->_inodes()} };
+    if (my $inode = $self->_inode) {
+        $find->{join(",", $self->_dev(), $inode)} =
+            scalar(@{$top->_dir_stack()});
+    }
+    $self->_set_inodes($find);
 
     $self->_last_dir_scanned(undef);
 
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.