From 98d37338dfbf0fdc64eaa0e9e1ae8c74977c9ef6 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 28 Apr 2024 18:30:02 +0200 Subject: [PATCH] Codechange: use ranged for loop instead of one with lengthof --- src/object_gui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 4fec20d2f6..daab1f04de 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -257,9 +257,9 @@ public: } /* Determine the pixel heights. */ - for (size_t i = 0; i < lengthof(height); i++) { - height[i] *= ScaleGUITrad(TILE_HEIGHT); - height[i] += ScaleGUITrad(TILE_PIXELS) + 2 * this->object_margin; + for (auto &h : height) { + h *= ScaleGUITrad(TILE_HEIGHT); + h += ScaleGUITrad(TILE_PIXELS) + 2 * this->object_margin; } /* Now determine the size of the minimum widgets. When there are two columns, then