Avoid window iterations when no windows of desired class present

This commit is contained in:
Jonathan G Rennison
2023-09-18 19:05:55 +01:00
parent 52e4688851
commit b93503bb21
5 changed files with 19 additions and 1 deletions

View File

@@ -1352,6 +1352,7 @@ static WindowDesc _query_desc(
static void RemoveExistingQueryWindow(Window *parent, QueryCallbackProc *callback)
{
if (!HaveWindowByClass(WC_CONFIRM_POPUP_QUERY)) return;
for (Window *w : Window::IterateFromBack()) {
if (w->window_class != WC_CONFIRM_POPUP_QUERY) continue;