Skip to content

Commit

Permalink
Avoid creating an intermediate vector (#1457)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Jun 26, 2024
1 parent b967552 commit 924b9b0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions executor/src/witgen/identity_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,10 @@ impl<'a, 'b, 'c, T: FieldElement, Q: QueryCallback<T>> IdentityProcessor<'a, 'b,
}
}

let left = identity
.left
.expressions
.iter()
.map(|e| rows.evaluate(e))
.collect::<Vec<_>>();
let left = identity.left.expressions.iter().map(|e| rows.evaluate(e));

// Fail if the LHS has an error.
let (left, errors): (Vec<_>, Vec<_>) = left.into_iter().partition_map(|x| match x {
let (left, errors): (Vec<_>, Vec<_>) = left.partition_map(|x| match x {
Ok(x) => Either::Left(x),
Err(x) => Either::Right(x),
});
Expand Down

0 comments on commit 924b9b0

Please sign in to comment.