#[derive(Clone)]
pub struct ReversePostorderIter<'a, 'tcx> {
body: &'a Body<'tcx>,
- blocks: &'a Vec<BasicBlock>,
+ blocks: &'a [BasicBlock],
idx: usize,
}
self.cache = OnceCell::new();
}
- /// Returns the &Vec<BasicBlocks> represents the postorder graph for this MIR.
+ /// Returns the `&[BasicBlocks]` represents the postorder graph for this MIR.
#[inline]
- pub(super) fn compute(&self, body: &Body<'_>) -> &Vec<BasicBlock> {
+ pub(super) fn compute(&self, body: &Body<'_>) -> &[BasicBlock] {
self.cache.get_or_init(|| Postorder::new(body, START_BLOCK).map(|(bb, _)| bb).collect())
}
}