Skip to content

Commit 32ffc2e

Browse files
committed
fix: fix linting errors
1 parent 4602f90 commit 32ffc2e

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/algorithms/island.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,10 @@ where
429429
self.total_evaluations = self.islands.iter().map(|i| i.evaluations).sum();
430430

431431
// Migration
432-
if self.generation % self.config.migration_interval == 0 {
432+
if self
433+
.generation
434+
.is_multiple_of(self.config.migration_interval)
435+
{
433436
self.migrate(rng);
434437
}
435438

src/algorithms/steady_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ where
512512
step_count += 1;
513513

514514
// Record statistics at generation boundaries
515-
if step_count % self.config.steps_per_generation == 0 {
515+
if step_count.is_multiple_of(self.config.steps_per_generation) {
516516
generation += 1;
517517
population.set_generation(generation);
518518

@@ -677,7 +677,7 @@ where
677677
step_count += 1;
678678

679679
// Record statistics at generation boundaries
680-
if step_count % self.config.steps_per_generation == 0 {
680+
if step_count.is_multiple_of(self.config.steps_per_generation) {
681681
generation += 1;
682682
population.set_generation(generation);
683683

src/checkpoint/recovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ impl CheckpointManager {
255255

256256
/// Check if a checkpoint should be saved at this generation
257257
pub fn should_save(&self, generation: usize) -> bool {
258-
generation > 0 && generation % self.interval == 0
258+
generation > 0 && generation.is_multiple_of(self.interval)
259259
}
260260

261261
/// Get the path for the current checkpoint

0 commit comments

Comments
 (0)