summaryrefslogtreecommitdiff
path: root/src/company_gui.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-12-16 18:01:57 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-12-21 20:13:03 +0100
commit4ae829cb272225c7e07e233a94c2d945077f432a (patch)
treefc762bd9bf0280661663fd136dd68a444fef734d /src/company_gui.cpp
parentf58ce3db19be038e2a0725b2dd28de9d6c27d416 (diff)
downloadopenttd-4ae829cb272225c7e07e233a94c2d945077f432a.tar.xz
Codechange: Replace FOR_ALL_GROUPS with range-based for loops
Diffstat (limited to 'src/company_gui.cpp')
-rw-r--r--src/company_gui.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/company_gui.cpp b/src/company_gui.cpp
index 92c6ccb53..423efcb01 100644
--- a/src/company_gui.cpp
+++ b/src/company_gui.cpp
@@ -658,8 +658,7 @@ private:
GUIGroupList list;
VehicleType vtype = (VehicleType)(this->livery_class - LC_GROUP_RAIL);
- const Group *g;
- FOR_ALL_GROUPS(g) {
+ for (const Group *g : Group::Iterate()) {
if (g->owner == owner && g->vehicle_type == vtype) {
list.push_back(g);
}
@@ -750,8 +749,7 @@ public:
}
/* And group names */
- const Group *g;
- FOR_ALL_GROUPS(g) {
+ for (const Group *g : Group::Iterate()) {
if (g->owner == (CompanyID)this->window_number) {
SetDParam(0, g->index);
d = maxdim(d, GetStringBoundingBox(STR_GROUP_NAME));