Skip to content

Commit 78acbe9

Browse files
committed
Add reset() function to cycle detector for safe reuse
1 parent b4c08b9 commit 78acbe9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libsolutil/Algorithms.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ class CycleDetector
6868
return m_firstCycleVertex;
6969
}
7070

71+
void reset()
72+
{
73+
m_processing.clear();
74+
m_processed.clear();
75+
m_depth = 0;
76+
m_firstCycleVertex = nullptr;
77+
}
78+
7179
private:
7280
Visitor m_visit;
7381
std::set<V const*> m_processing;

0 commit comments

Comments
 (0)