diff options
| author | mat <git@matdoes.dev> | 2025-07-01 02:45:53 +0700 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-07-24 19:06:01 +1200 |
| commit | 63348dbbea2a9483c07dfc74ab363f34cc8054bc (patch) | |
| tree | 261d35cfa3dcc88cbbe6e371d36dc5c8c6bb537e /azalea | |
| parent | df9d776ff8e3945ce7d367e6cecb54957ee0fd7a (diff) | |
| download | azalea-drasl-63348dbbea2a9483c07dfc74ab363f34cc8054bc.tar.xz | |
clippy: use is_multiple_of
Diffstat (limited to 'azalea')
| -rw-r--r-- | azalea/src/pathfinder/astar.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/azalea/src/pathfinder/astar.rs b/azalea/src/pathfinder/astar.rs index 8d23ed2e..71e0b9ef 100644 --- a/azalea/src/pathfinder/astar.rs +++ b/azalea/src/pathfinder/astar.rs @@ -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, |
