Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Nov 13, 2024
1 parent b35fa25 commit 7ffda95
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions compiler/noirc_evaluator/src/ssa/opt/unrolling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,8 @@ impl Loops {
fn unroll_each(mut self, function: &mut Function) -> Vec<RuntimeError> {
let mut unroll_errors = vec![];
while let Some(next_loop) = self.yet_to_unroll.pop() {
if function.runtime().is_brillig() {
if !next_loop.is_small_loop(function, &self.cfg) {
continue;
}
if function.runtime().is_brillig() && !next_loop.is_small_loop(function, &self.cfg) {
continue;
}
// If we've previously modified a block in this loop we need to refresh the context.
// This happens any time we have nested loops.
Expand Down Expand Up @@ -1136,7 +1134,7 @@ mod tests {
let mut loops = Loops::find_all(function);
let loop0 = loops.yet_to_unroll.pop().unwrap();
let stats = loop0.boilerplate_stats(function, &loops.cfg).unwrap();
assert_eq!(stats.is_small(), false);
assert!(!stats.is_small(), "the loop should be considered large");

let (ssa, errors) = ssa.try_unroll_loops();
assert_eq!(errors.len(), 0, "Unroll should have no errors");
Expand Down

0 comments on commit 7ffda95

Please sign in to comment.