Merge pull request #584 from quake/quake/optimize-stmt-switch
fix: optimize_stmt should use fn `position`
This commit is contained in:
commit
87af0db074
@ -745,7 +745,7 @@ fn optimize_stmt(stmt: &mut Stmt, state: &mut OptimizerState, preserve_result: b
|
|||||||
// Remove all entries after a `true` condition
|
// Remove all entries after a `true` condition
|
||||||
if let Some(n) = list
|
if let Some(n) = list
|
||||||
.iter()
|
.iter()
|
||||||
.find(|&&index| match case_blocks[index].condition {
|
.position(|&index| match case_blocks[index].condition {
|
||||||
Expr::BoolConstant(true, ..) => true,
|
Expr::BoolConstant(true, ..) => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user