Skip to content

Commit

Permalink
Refactor compute_coset_elements
Browse files Browse the repository at this point in the history
  • Loading branch information
fmkra committed Dec 27, 2023
1 parent 77bb792 commit 02b604d
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/fri/fri_layer.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,13 @@ fn compute_coset_elements(
break;
}

match queries.get(0) {
Option::Some(q) => {
if *q.unbox().index == coset_start_index + offset_within_coset {
let query = *queries.pop_front().unwrap();
coset_elements.append(query.y_value);
coset_x_inv = (query.x_inv_value) * (*fri_group.at(i));
} else {
coset_elements.append(*sibling_witness.pop_front().unwrap());
}
},
Option::None => { coset_elements.append(*sibling_witness.pop_front().unwrap()); },
let q = queries.get(0);
if q.is_some() && *q.unwrap().unbox().index == coset_start_index + offset_within_coset {
let query = *queries.pop_front().unwrap();
coset_elements.append(query.y_value);
coset_x_inv = (query.x_inv_value) * (*fri_group.at(i));
} else {
coset_elements.append(*sibling_witness.pop_front().unwrap());
}

i += 1;
Expand Down

0 comments on commit 02b604d

Please sign in to comment.