style(simulation): gate bounce — fmt wrap + clippy needless_range_loop
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2188,7 +2188,9 @@ fn lake_from_hydrology_at(ta: &TerrainAnalysis, px: f64, py: f64) -> (bool, i32)
|
||||
0
|
||||
} else {
|
||||
let depth = (filled - original).max(0.0);
|
||||
((depth / basin_max_depth) * 100.0).round().clamp(0.0, 100.0) as i32
|
||||
((depth / basin_max_depth) * 100.0)
|
||||
.round()
|
||||
.clamp(0.0, 100.0) as i32
|
||||
}
|
||||
} else {
|
||||
0
|
||||
|
||||
@@ -417,13 +417,13 @@ pub fn solve(
|
||||
// built from — walked directly here rather than through `basins` to
|
||||
// avoid a second clone of every basin's cell list.
|
||||
let mut basin_max_depth_scaled = vec![0i64; n];
|
||||
for b in 0..basin_count {
|
||||
let max_depth = basin_cells[b]
|
||||
for cells in basin_cells.iter().take(basin_count) {
|
||||
let max_depth = cells
|
||||
.iter()
|
||||
.map(|&c| (filled[c] - original[c]).max(0))
|
||||
.max()
|
||||
.unwrap_or(0);
|
||||
for &c in &basin_cells[b] {
|
||||
for &c in cells {
|
||||
basin_max_depth_scaled[c] = max_depth;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user