Commits

Anonymous committed 15fd75d

Extracted _copy methods from more places in the code.

Comments (0)

Files changed (2)

lib/File/Find/Object.pm

     {
         $tree->set($opt, $options->{$opt});
     }
-    $tree->_targets([ @targets ]);
+    $tree->_targets(\@targets);
     $tree->_target_index(-1);
     $tree->_reset_actions();
 
 {
     my $self = shift;
 
-    return [ @{$self->_current->_traverse_to()} ];
+    return $self->_current->_traverse_to_copy();
 }
 
 sub get_current_node_files_list
     # _open_dir can return undef if $self->_current is not a directory.
     if ($self->_open_dir())
     {
-        return [ @{$self->_current->_files()}];
+        return $self->_current->_files_copy();
     }
     else
     {

lib/File/Find/Object/Base.pm

 
 __PACKAGE__->_make_copy_methods([qw(
         _dir
+        _files
+        _traverse_to
     )]
 );
 
 {
     my $self = shift;
 
-    my $files = $self->_calc_dir_files();
+    $self->_files($self->_calc_dir_files());
 
-    $self->_files(
-        [ @$files ]
-    );
-    $self->_traverse_to(
-        [ @$files ]
-    );
+    $self->_traverse_to($self->_files_copy());
     
     $self->_mystat();
 
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.