mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 14:23:07 +00:00
Rewrite add_many
This commit is contained in:
parent
817fe1e3a3
commit
c2ca106a29
@ -185,11 +185,7 @@ impl<F: RichField + Extendable<D>, const D: usize> CircuitBuilder<F, D> {
|
||||
|
||||
/// Add `n` `Target`s.
|
||||
pub fn add_many(&mut self, terms: &[Target]) -> Target {
|
||||
let terms_ext = terms
|
||||
.iter()
|
||||
.map(|&t| self.convert_to_ext(t))
|
||||
.collect::<Vec<_>>();
|
||||
self.add_many_extension(&terms_ext).to_target_array()[0]
|
||||
terms.iter().fold(self.zero(), |acc, &t| self.add(acc, t))
|
||||
}
|
||||
|
||||
/// Computes `x - y`.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user