1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

clippy: use is_multiple_of

This commit is contained in:
mat 2025-07-01 02:45:53 +07:00
parent df9d776ff8
commit 63348dbbea

View file

@ -65,7 +65,7 @@ where
let mut best_paths: [usize; 7] = [0; 7];
let mut best_path_scores: [f32; 7] = [heuristic(start); 7];
let mut num_nodes = 0;
let mut num_nodes = 0_usize;
let mut num_movements = 0;
while let Some(WeightedNode { index, g_score, .. }) = open_set.pop() {
@ -136,7 +136,7 @@ where
}
// check for timeout every ~10ms
if num_nodes % 10000 == 0 {
if num_nodes.is_multiple_of(10_000) {
let min_timeout_reached = match min_timeout {
PathfinderTimeout::Time(max_duration) => start_time.elapsed() >= max_duration,
PathfinderTimeout::Nodes(max_nodes) => num_nodes >= max_nodes,