Skip to content

Commit 577f1f2

Browse files
committed
Address review comment
1 parent 07896fd commit 577f1f2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

relations/src/utils/linear_combination.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,11 @@ impl<F: Field> LinearCombination<F> {
8989
pub fn sum_vars(variables: &[Variable]) -> Self {
9090
let lc = variables
9191
.iter()
92-
.map(|&var| var)
93-
.into_iter()
94-
.chunk_by(|&x| x)
95-
.into_iter()
96-
.map(|(var, group)| (F::from(group.count() as u64), var))
92+
.map(|&var| (F::ONE, var))
9793
.collect::<Vec<_>>();
98-
Self(lc)
94+
let mut lc = LinearCombination(lc);
95+
lc.compactify();
96+
lc
9997
}
10098

10199
/// Create a new linear combination from the sum of many (coefficient, variable) pairs.

0 commit comments

Comments
 (0)