From 5fec152ad60d09cba8329f9e42748c84bc4591d4 Mon Sep 17 00:00:00 2001 From: Adam Washington Date: Thu, 7 May 2026 09:23:00 +0100 Subject: [PATCH] Fix Array3D iterator --- src/classes/array3DIterator.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/classes/array3DIterator.cpp b/src/classes/array3DIterator.cpp index f6a139da2b..f581532b97 100644 --- a/src/classes/array3DIterator.cpp +++ b/src/classes/array3DIterator.cpp @@ -3,7 +3,6 @@ #include "classes/array3DIterator.h" #include -#include Array3DIterator::Array3DIterator() {} @@ -25,11 +24,11 @@ int Array3DIterator::toIndex() const { return x_ + sizeX_ * y_ + sizeX_ * sizeY_ bool Array3DIterator::operator<(const Array3DIterator &other) const { - if (x_ != other.x_) - return x_ < other.x_; + if (z_ != other.z_) + return z_ < other.z_; if (y_ != other.y_) return y_ < other.y_; - return z_ < other.z_; + return x_ < other.x_; } bool Array3DIterator::operator==(const Array3DIterator &other) const {