Rewrite add_many

This commit is contained in:
wborgeaud 2021-12-02 16:56:58 +01:00
parent 817fe1e3a3
commit c2ca106a29

View File

@ -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`.