Use &IndexSlice
instead of &IndexVec
where possible
All the same reasons as for `[T]`: more general, less pointer chasing, and `&mut IndexSlice` emphasizes that it doesn't change *length*.
This commit is contained in:
parent
a93bcdc307
commit
a2ee7592d6
42 changed files with 168 additions and 118 deletions
|
@ -1,6 +1,6 @@
|
|||
use super::{DirectedGraph, WithNumNodes, WithStartNode, WithSuccessors};
|
||||
use rustc_index::bit_set::BitSet;
|
||||
use rustc_index::vec::IndexVec;
|
||||
use rustc_index::vec::{IndexSlice, IndexVec};
|
||||
use std::ops::ControlFlow;
|
||||
|
||||
#[cfg(test)]
|
||||
|
@ -31,7 +31,7 @@ fn post_order_walk<G: DirectedGraph + WithSuccessors + WithNumNodes>(
|
|||
graph: &G,
|
||||
node: G::Node,
|
||||
result: &mut Vec<G::Node>,
|
||||
visited: &mut IndexVec<G::Node, bool>,
|
||||
visited: &mut IndexSlice<G::Node, bool>,
|
||||
) {
|
||||
struct PostOrderFrame<Node, Iter> {
|
||||
node: Node,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue