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 commit6ae8912a3e, reversing changes made to86d6d2b738.
This commit is contained in:
@@ -206,11 +206,17 @@ impl<N: Debug, E: Debug> Graph<N, E> {
|
||||
AdjacentEdges { graph: self, direction, next: first_edge }
|
||||
}
|
||||
|
||||
pub fn successor_nodes(&self, source: NodeIndex) -> impl Iterator<Item = NodeIndex> + '_ {
|
||||
pub fn successor_nodes<'a>(
|
||||
&'a self,
|
||||
source: NodeIndex,
|
||||
) -> impl Iterator<Item = NodeIndex> + 'a {
|
||||
self.outgoing_edges(source).targets()
|
||||
}
|
||||
|
||||
pub fn predecessor_nodes(&self, target: NodeIndex) -> impl Iterator<Item = NodeIndex> + '_ {
|
||||
pub fn predecessor_nodes<'a>(
|
||||
&'a self,
|
||||
target: NodeIndex,
|
||||
) -> impl Iterator<Item = NodeIndex> + 'a {
|
||||
self.incoming_edges(target).sources()
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user