Skip to content

Commit

Permalink
remove unnecessary while loop
Browse files Browse the repository at this point in the history
  • Loading branch information
sinui0 committed Oct 19, 2023
1 parent 6e0e393 commit 3ff3119
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions garble/mpz-garble/src/evaluator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,16 +372,14 @@ impl Evaluator {
let encoded_outputs = if let Some(GarbledCircuit { gates, commitments }) =
existing_garbled_circuit
{
while !ev.is_complete() {
for batch in gates.chunks(self.config.batch_size) {
let batch = batch.to_vec();
// Move the evaluator to a new thread to process the batch then send it back
ev = Backend::spawn(move || {
ev.evaluate(batch.iter());
ev
})
.await;
}
for batch in gates.chunks(self.config.batch_size) {
let batch = batch.to_vec();
// Move the evaluator to a new thread to process the batch then send it back
ev = Backend::spawn(move || {
ev.evaluate(batch.iter());
ev
})
.await;
}

let encoded_outputs = ev.outputs()?;
Expand Down

0 comments on commit 3ff3119

Please sign in to comment.