From 5e2398be7414abe3dd3f0865f41a55f3896c1b2e Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Wed, 9 Sep 2026 15:39:12 +0000 Subject: [PATCH] Explain why the selective color and spline loops index by range --- node-graph/nodes/raster/src/adjustments.rs | 2 ++ node-graph/nodes/raster/src/cubic_spline.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/node-graph/nodes/raster/src/adjustments.rs b/node-graph/nodes/raster/src/adjustments.rs index 4afdbcc2c2..4e4d1e393b 100644 --- a/node-graph/nodes/raster/src/adjustments.rs +++ b/node-graph/nodes/raster/src/adjustments.rs @@ -950,6 +950,8 @@ fn selective_color + Clone + Send + Sync + no_std_types::contex (SelectiveColorChoice::Blacks, (k_c, k_m, k_y, k_k)), ]; let mut sum = Vec3::ZERO; + // Indexed rather than iterated because this compiles to SPIR-V, whose backend rejects the arbitrary pointer offset an array iterator produces + #[allow(clippy::needless_range_loop)] for i in 0..array.len() { let (color_parameter_group, (c, m, y, k)) = array[i]; diff --git a/node-graph/nodes/raster/src/cubic_spline.rs b/node-graph/nodes/raster/src/cubic_spline.rs index f57f699beb..67f153623a 100644 --- a/node-graph/nodes/raster/src/cubic_spline.rs +++ b/node-graph/nodes/raster/src/cubic_spline.rs @@ -63,6 +63,8 @@ impl CubicSplines { assert!(augmented_matrix[row][row].abs() > f32::EPSILON); let scale_factor = augmented_matrix[row_below_current][row] / augmented_matrix[row][row]; + // `col` indexes two distinct rows at once, one of them mutably, so an iterator would need a split borrow + #[allow(clippy::needless_range_loop)] for col in row..5 { augmented_matrix[row_below_current][col] -= augmented_matrix[row][col] * scale_factor }