Skip to content

Commit c0c97c0

Browse files
committed
ZJIT: Simplify po_from to take a single BlockId
1 parent e6f73fc commit c0c97c0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

zjit/src/hir.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5009,20 +5009,20 @@ impl Function {
50095009

50105010
/// Return a traversal of the `Function`'s `BlockId`s in reverse post-order.
50115011
pub fn rpo(&self) -> Vec<BlockId> {
5012-
let mut result = self.po_from(vec![self.entries_block]);
5012+
let mut result = self.po_from(self.entries_block);
50135013
result.reverse();
50145014
result
50155015
}
50165016

5017-
fn po_from(&self, starts: Vec<BlockId>) -> Vec<BlockId> {
5017+
fn po_from(&self, start: BlockId) -> Vec<BlockId> {
50185018
#[derive(PartialEq)]
50195019
enum Action {
50205020
VisitEdges,
50215021
VisitSelf,
50225022
}
50235023
let mut result = vec![];
50245024
let mut seen = BlockSet::with_capacity(self.blocks.len());
5025-
let mut stack: Vec<_> = starts.iter().map(|&start| (start, Action::VisitEdges)).collect();
5025+
let mut stack = vec![(start, Action::VisitEdges)];
50265026
while let Some((block, action)) = stack.pop() {
50275027
if action == Action::VisitSelf {
50285028
result.push(block);

0 commit comments

Comments
 (0)