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:
@@ -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 ---
|
||||
|
||||
Reference in New Issue
Block a user