fix: optimize_stmt should use fn position

This commit is contained in:
quake 2022-07-20 18:48:54 +09:00
parent 4f26c1465c
commit e21f7c4f5d

View File

@ -745,7 +745,7 @@ fn optimize_stmt(stmt: &mut Stmt, state: &mut OptimizerState, preserve_result: b
// Remove all entries after a `true` condition
if let Some(n) = list
.iter()
.find(|&&index| match case_blocks[index].condition {
.position(|&index| match case_blocks[index].condition {
Expr::BoolConstant(true, ..) => true,
_ => false,
})