Commits

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

Extracted _copy methods from more places in the code.

  • Participants
  • Parent commits 452cfeb

Comments (0)

Files changed (2)

File 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
     {

File 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();