Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid uneccessary copies in generated VisitorTransforms
Previously, the generated VisitorTransform classes *always* made a deep copy of the input tree. With this commit, only those nodes which are actually changed will be copied. In the transform*() functions of the VisitorTransform super classes, we now check to see if all of the new child nodes are the same instance as the original child nodes. If so, there is no need to copy the original node. Note that this does not apply to cross-domain visitor transforms since the type of the nodes is changing, it is still neccessary to perform the deep copy.
- Loading branch information