mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-10 17:53:06 +00:00
Tweak
This commit is contained in:
parent
44a5e0be1b
commit
8b309fef41
@ -160,11 +160,9 @@ impl<F: Field> Add for &PolynomialCoeffs<F> {
|
||||
|
||||
fn add(self, rhs: Self) -> Self::Output {
|
||||
let len = max(self.len(), rhs.len());
|
||||
let mut coeffs = self.coeffs.clone();
|
||||
coeffs.resize(len, F::ZERO);
|
||||
for (i, &c) in rhs.coeffs.iter().enumerate() {
|
||||
coeffs[i] += c;
|
||||
}
|
||||
let a = self.padded(len).coeffs;
|
||||
let b = rhs.padded(len).coeffs;
|
||||
let coeffs = a.into_iter().zip(b).map(|(x, y)| x + y).collect();
|
||||
PolynomialCoeffs::new(coeffs)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user