From: Joshua Simmons Date: Fri, 3 May 2024 06:35:18 +0000 (+0200) Subject: narcissus-maths: Small cleanup of perlin noise X-Git-Url: https://git.nega.tv//gitweb.cgi?a=commitdiff_plain;h=ac24a0486e4493718ac954e4f0a3dac835961ebb;p=josh%2Fnarcissus narcissus-maths: Small cleanup of perlin noise --- diff --git a/engine/narcissus-maths/src/perlin.rs b/engine/narcissus-maths/src/perlin.rs index 141c0a5..de7dc6d 100644 --- a/engine/narcissus-maths/src/perlin.rs +++ b/engine/narcissus-maths/src/perlin.rs @@ -91,9 +91,9 @@ fn grad(index: usize, x: f32, y: f32, z: f32) -> f32 { // Unfortunately the compiler does not track the range of values in INDICES, // and so cannot see a bounds check is superflous here. Do it ourselves. - + // // SAFETY: const loop asserts all values in INDICES are in bounds for BASIS. - let [a, b, c] = unsafe { + let &[a, b, c] = unsafe { const _: () = { let mut i = 0; while i < INDICES.len() {