chore: fix clippy warnings in NSGA-III, SPEA2, and compare example

- nsga3: drop redundant `.into_iter()` in extend call; use
  `#[allow(clippy::needless_range_loop)]` on the back-substitution
  loop where `j` indexes into the matrix; remove an unneeded
  `return` keyword in a closure.
- spea2: switch `pool.extend(x.drain(..))` to `pool.append(&mut x)`.
- examples/compare.rs DTLZ2 evaluator: same `needless_range_loop`
  silencer on the inner cosine product loop.
This commit is contained in:
2026-05-04 19:59:18 -06:00
parent 5728ee14e2
commit ac1a5856cf
3 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -87,8 +87,8 @@ where
// --- Combine pool, compute fitness ---
let mut pool: Vec<Candidate<P::Decision>> =
Vec::with_capacity(population.len() + archive.len());
pool.extend(population.drain(..));
pool.extend(archive.drain(..));
pool.append(&mut population);
pool.append(&mut archive);
let fitness = compute_fitness(&pool, &objectives);
// --- Build the next archive ---