Skip to content

Commit

Permalink
Fix bugs in EffectNode cycle detection algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
SirBob01 committed May 17, 2023
1 parent 8f3f53e commit 0b00302
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Sound/EffectNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ namespace Dynamo::Sound {
b8 EffectNode::has_cycles() {
std::unordered_set<EffectNode *> visited;
std::vector<std::reference_wrapper<EffectNode>> stack;

stack.push_back(*this);
while (!stack.empty()) {
EffectNode &node = stack.back();
stack.pop_back();
Expand All @@ -13,6 +15,7 @@ namespace Dynamo::Sound {
for (EffectNode &child : node._outgoing) {
stack.push_back(child);
}
visited.insert(&node);
}
return false;
}
Expand Down

0 comments on commit 0b00302

Please sign in to comment.