Rearrange iteration pattern so that x is in the inner loop in the default for_each_in (no or little perf change)

This commit is contained in:
Imbris 2021-10-10 02:31:53 -04:00
parent 11c8cf19d1
commit 57922d9802

View File

@ -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);
}