Clone creates and returns a deep copy of the tree from this node down. Any pointers within the cloned tree will correctly point within the new cloned tree (see [Node.CopyFrom] for more information).
()
| 694 | // Any pointers within the cloned tree will correctly point within the new |
| 695 | // cloned tree (see [Node.CopyFrom] for more information). |
| 696 | func (n *NodeBase) Clone() Node { |
| 697 | nc := n.NewInstance() |
| 698 | InitNode(nc) |
| 699 | nc.AsTree().SetName(n.Name) |
| 700 | nc.AsTree().CopyFrom(n.This) |
| 701 | return nc |
| 702 | } |
| 703 | |
| 704 | // CopyFieldsFrom copies the fields of the node from the given node. |
| 705 | // By default, it is [NodeBase.CopyFieldsFrom], which automatically does |
nothing calls this directly
no test coverage detected