fix: optimize_stmt should use fn position
This commit is contained in:
parent
4f26c1465c
commit
e21f7c4f5d
@ -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,
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user