diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-10-15 11:24:20 +0200 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2021-10-15 11:28:23 +0200 |
| commit | 44570143989cdd529aff488b8fa5534c4802fbce (patch) | |
| tree | 6ac2b6660b1055c06b20475a05eec0f9359d1143 /compiler/rustc_data_structures/src/graph/iterate | |
| parent | 72d66064e77281536588189a916af28a1819b313 (diff) | |
| download | rust-44570143989cdd529aff488b8fa5534c4802fbce.tar.gz rust-44570143989cdd529aff488b8fa5534c4802fbce.zip | |
Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, r=petrochenkov"
The PR had some unforseen perf regressions that are not as easy to find. Revert the PR for now. This reverts commit 6ae8912a3e7d2c4c775024f58a7ba4b1aedc4073, reversing changes made to 86d6d2b7389fe1b339402c1798edae8b695fc9ef.
Diffstat (limited to 'compiler/rustc_data_structures/src/graph/iterate')
| -rw-r--r-- | compiler/rustc_data_structures/src/graph/iterate/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_data_structures/src/graph/iterate/mod.rs b/compiler/rustc_data_structures/src/graph/iterate/mod.rs index 1c6979dc489..a9db3497b23 100644 --- a/compiler/rustc_data_structures/src/graph/iterate/mod.rs +++ b/compiler/rustc_data_structures/src/graph/iterate/mod.rs @@ -48,7 +48,7 @@ fn post_order_walk<G: DirectedGraph + WithSuccessors + WithNumNodes>( let node = frame.node; visited[node] = true; - for successor in frame.iter.by_ref() { + while let Some(successor) = frame.iter.next() { if !visited[successor] { stack.push(PostOrderFrame { node: successor, iter: graph.successors(successor) }); continue 'recurse; @@ -112,7 +112,7 @@ where /// This is equivalent to just invoke `next` repeatedly until /// you get a `None` result. pub fn complete_search(&mut self) { - for _ in self {} + while let Some(_) = self.next() {} } /// Returns true if node has been visited thus far. |
