Codechange: Replace window related FOR_ALL with range-based for loops

(cherry picked from commit 14e92bd8e2)
This commit is contained in:
glx22
2021-04-28 21:24:24 +02:00
committed by Jonathan G Rennison
parent c7cac34025
commit dfe616bef4
11 changed files with 130 additions and 156 deletions

View File

@@ -2531,8 +2531,7 @@ void DirtyVehicleListWindowForVehicle(const Vehicle *v)
{
WindowClass cls = static_cast<WindowClass>(WC_TRAINS_LIST + v->type);
WindowClass cls2 = (v->type == VEH_TRAIN) ? WC_TRACE_RESTRICT_SLOTS : cls;
Window *w;
FOR_ALL_WINDOWS_FROM_BACK(w) {
for (Window *w : Window::IterateFromBack()) {
if (w->window_class == cls || w->window_class == cls2) {
BaseVehicleListWindow *listwin = static_cast<BaseVehicleListWindow *>(w);
uint max = std::min<uint>(listwin->vscroll->GetPosition() + listwin->vscroll->GetCapacity(), (uint)listwin->vehgroups.size());