| 281 | } |
| 282 | |
| 283 | static void MoveToList(GraphCycles::Rep* r, Vec<int32>* src, Vec<int32>* dst) { |
| 284 | for (Vec<int32>::size_type i = 0; i < src->size(); i++) { |
| 285 | int32 w = (*src)[i]; |
| 286 | (*src)[i] = r->nodes_[w]->rank; // Replace src entry with its rank |
| 287 | r->nodes_[w]->visited = false; // Prepare for future DFS calls |
| 288 | dst->push_back(w); |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | static void ClearVisitedBits(GraphCycles::Rep* r, const Vec<int32>& nodes) { |
| 293 | for (Vec<int32>::size_type i = 0; i < nodes.size(); i++) { |