mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-27 12:13:41 +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 {
|
fn is_constant(&self) -> bool {
|
||||||
let mut constant = true;
|
|
||||||
|
|
||||||
// If any bits of self are allocated bits, return false
|
// If any bits of self are allocated bits, return false
|
||||||
for bit in &self.bits {
|
self.bits.iter().all(|bit| matches!(bit, Boolean::Constant(_)))
|
||||||
match *bit {
|
|
||||||
Boolean::Is(ref _bit) => constant = false,
|
|
||||||
Boolean::Not(ref _bit) => constant = false,
|
|
||||||
Boolean::Constant(_bit) => {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
constant
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user