-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: refactor DynamicGraph print method #1060
base: master
Are you sure you want to change the base?
Conversation
clang-tidy review says "All clean, LGTM! 👍" |
@Abhinavcode13, the test failures are mostly due to the old graph printing style in tests. |
std::unordered_set<size_t> visited; | ||
|
||
// Recursive function to print nodes with indentation based on depth. | ||
std::function<void(size_t, int)> printNode = [&](size_t nodeId, int depth) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::function<void(size_t, int)> printNode = [&](size_t nodeId, int depth) { | |
auto printNode = [&](size_t nodeId, int depth) { |
I believe we can the recursion with the cheaper iteration approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Abhinavcode13, ping.
Co-authored-by: Vassil Vassilev <v.g.vassilev@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
|
||
// Recursively print all children (nodes connected by edges). | ||
for (size_t destId : m_adjList[nodeId]) { | ||
printNode(destId, depth + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'printNode' declared with deduced type 'auto' cannot appear in its own initializer [clang-diagnostic-error]
printNode(destId, depth + 1);
^
clang-tidy review says "All clean, LGTM! 👍" |
Fixes: #1009