Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Assign unique id to Node copy. #619

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Assign unique id to Node copy. #619

merged 1 commit into from
Aug 7, 2023

Conversation

ienkovich
Copy link
Contributor

We assume that all nodes in DAG have unique IDs but Node::deepCopy method returns a node with the same ID. Fix it by defining a copy ctor for Node.

Resolves #617

Node::Node(const Node& other)
: inputs_(other.inputs_)
, id_(crt_id_.fetch_add(1))
, context_data_(nullptr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is basically a shallow copy. Do we need it at all? I.e. would it be reasonable to have the copy constructor do a deep copy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a legacy function name. Previously, it was used to deep-copy all expressions referenced by the node. But we switched to immutable expressions, so there is no point to deep-copy them anymore. So, all our deepCopy implementations simply call copy-constructors now.

@ienkovich ienkovich merged commit 6164145 into main Aug 7, 2023
@ienkovich ienkovich deleted the ienkovich/issue-617 branch August 7, 2023 17:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Execution aborted in taxi Q4 on randomly generated taxi data
2 participants