diff --git a/crates/torin/benches/bench.rs b/crates/torin/benches/bench.rs index ba2831113..55c3efcbc 100644 --- a/crates/torin/benches/bench.rs +++ b/crates/torin/benches/bench.rs @@ -170,9 +170,7 @@ fn criterion_benchmark(c: &mut Criterion) { for level in 0..levels { for i in &children_ids { let id = (level * 1000) + *i; - let children = if level == levels - 1 { - vec![] - } else if *i == 101 { + let children = if *i == 101 && level < levels - 1 { (1..101) .map(move |i| i + ((level + 1) * 1000)) .collect::>() @@ -255,9 +253,7 @@ fn criterion_benchmark(c: &mut Criterion) { for level in 0..levels { for i in &children_ids { let id = (level * 1000) + *i; - let children = if level == levels - 1 { - vec![] - } else if *i == 101 { + let children = if *i == 101 && level < levels - 1 { (1..101) .map(move |i| i + ((level + 1) * 1000)) .collect::>() @@ -340,9 +336,7 @@ fn criterion_benchmark(c: &mut Criterion) { for level in 0..levels { for i in &children_ids { let id = (level * 1000) + *i; - let children = if level == levels - 1 { - vec![] - } else if *i == 101 { + let children = if *i == 101 && level < levels - 1 { (1..101) .map(move |i| i + ((level + 1) * 1000)) .collect::>()