a small refactoring for readability
This commit is contained in:
parent
6904fd5a49
commit
25bbde091a
@ -87,12 +87,11 @@ fn run(&mut self, e: &'v Expr) -> Result<Bool, String> {
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
if let Some((n, _)) = self.terminals
|
||||
.iter()
|
||||
.enumerate()
|
||||
.find(|&(_, expr)| SpanlessEq::new(self.cx).ignore_fn().eq_expr(e, expr)) {
|
||||
#[allow(cast_possible_truncation)]
|
||||
return Ok(Bool::Term(n as u8));
|
||||
for (n, expr) in self.terminals.iter().enumerate() {
|
||||
if SpanlessEq::new(self.cx).ignore_fn().eq_expr(e, expr) {
|
||||
#[allow(cast_possible_truncation)]
|
||||
return Ok(Bool::Term(n as u8));
|
||||
}
|
||||
}
|
||||
let n = self.terminals.len();
|
||||
self.terminals.push(e);
|
||||
|
Loading…
Reference in New Issue
Block a user