Codechange: use IterateFromBack/Front only if the order is important.

Use Iterate if the order does not matter.
This commit is contained in:
frosch
2021-05-09 17:10:07 +02:00
committed by frosch
parent 22567a1f43
commit f96f113951
6 changed files with 41 additions and 39 deletions

View File

@@ -1480,7 +1480,7 @@ void ViewportSign::MarkDirty(ZoomLevel maxzoom) const
zoomlevels[zoom].bottom = this->top + ScaleByZoom(VPSM_TOP + FONT_HEIGHT_NORMAL + VPSM_BOTTOM + 1, zoom);
}
for (const Window *w : Window::IterateFromBack()) {
for (const Window *w : Window::Iterate()) {
Viewport *vp = w->viewport;
if (vp != nullptr && vp->zoom <= maxzoom) {
assert(vp->width != 0);
@@ -1953,7 +1953,7 @@ bool MarkAllViewportsDirty(int left, int top, int right, int bottom)
{
bool dirty = false;
for (const Window *w : Window::IterateFromBack()) {
for (const Window *w : Window::Iterate()) {
Viewport *vp = w->viewport;
if (vp != nullptr) {
assert(vp->width != 0);
@@ -1966,7 +1966,7 @@ bool MarkAllViewportsDirty(int left, int top, int right, int bottom)
void ConstrainAllViewportsZoom()
{
for (Window *w : Window::IterateFromFront()) {
for (Window *w : Window::Iterate()) {
if (w->viewport == nullptr) continue;
ZoomLevel zoom = static_cast<ZoomLevel>(Clamp(w->viewport->zoom, _settings_client.gui.zoom_min, _settings_client.gui.zoom_max));