Create variable instead of reference when accessing the stack

This commit is contained in:
stefiosif
2022-06-11 19:17:37 +03:00
parent 89a2a24f50
commit dfa8e649ee

View File

@@ -56,7 +56,7 @@ void Tarjan<T>::strongConnect(const T& v) {
std::vector<T> SCC; std::vector<T> SCC;
bool finished = false; bool finished = false;
do { do {
const auto& w = S.top(); const auto w = S.top();
S.pop(); S.pop();
vp[w].onStack = false; vp[w].onStack = false;
SCC.push_back(w); SCC.push_back(w);