mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-26 19:51:52 +03:00
perf: make signed_integer's is_constant method faster
Signed-off-by: ljedrz <ljedrz@gmail.com>
This commit is contained in:
parent
153202752f
commit
afe669babd
@ -82,18 +82,8 @@ macro_rules! int_impl {
|
||||
}
|
||||
|
||||
fn is_constant(&self) -> bool {
|
||||
let mut constant = true;
|
||||
|
||||
// If any bits of self are allocated bits, return false
|
||||
for bit in &self.bits {
|
||||
match *bit {
|
||||
Boolean::Is(ref _bit) => constant = false,
|
||||
Boolean::Not(ref _bit) => constant = false,
|
||||
Boolean::Constant(_bit) => {}
|
||||
}
|
||||
}
|
||||
|
||||
constant
|
||||
self.bits.iter().all(|bit| matches!(bit, Boolean::Constant(_)))
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user