From 57922d9802216bd039c9e41b7a8c696b337ee4d5 Mon Sep 17 00:00:00 2001 From: Imbris Date: Sun, 10 Oct 2021 02:31:53 -0400 Subject: [PATCH] Rearrange iteration pattern so that x is in the inner loop in the default for_each_in (no or little perf change) --- common/src/vol.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/vol.rs b/common/src/vol.rs index 4d1d4a305e..1e008f4e71 100644 --- a/common/src/vol.rs +++ b/common/src/vol.rs @@ -119,9 +119,9 @@ pub trait ReadVol: BaseVol { where Self::Vox: Copy, { - for x in aabb.min.x..aabb.max.x + 1 { + for z in aabb.min.z..aabb.max.z + 1 { for y in aabb.min.y..aabb.max.y + 1 { - for z in aabb.min.z..aabb.max.z + 1 { + for x in aabb.min.x..aabb.max.x + 1 { if let Ok(block) = self.get(Vec3::new(x, y, z)) { f(Vec3::new(x, y, z), *block); }