perf: make Address is_constant method faster

Signed-off-by: ljedrz <ljedrz@gmail.com>
This commit is contained in:
ljedrz 2020-10-21 12:11:25 +02:00
parent afe669babd
commit e5f47b8254

View File

@ -60,13 +60,7 @@ impl Address {
}
pub(crate) fn is_constant(&self) -> bool {
let mut result = true;
for byte in self.bytes.iter() {
result = result && byte.is_constant()
}
result
self.bytes.iter().all(|byte| byte.is_constant())
}
pub(crate) fn from_input<F: Field + PrimeField, G: GroupType<F>, CS: ConstraintSystem<F>>(