Eliminate double list traversal in copy_trees