From 0ed54d6643bd616bd4ce6e605cebffd97467ca8b Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 26 May 2025 15:15:46 -0400 Subject: [PATCH] Skip some unnecessary work in layout-only mode --- src/mainwindow.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8d2cef6f..9d26a739 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2333,11 +2333,12 @@ void MainWindow::displayEventTabs() { } void MainWindow::updateEvents() { - if (this->editor->map) { - for (auto i = this->lastSelectedEvent.begin(); i != this->lastSelectedEvent.end(); i++) { - if (i.value() && !this->editor->map->hasEvent(i.value())) - this->lastSelectedEvent.insert(i.key(), nullptr); - } + if (!this->editor->map) + return; + + for (auto i = this->lastSelectedEvent.begin(); i != this->lastSelectedEvent.end(); i++) { + if (i.value() && !this->editor->map->hasEvent(i.value())) + this->lastSelectedEvent.insert(i.key(), nullptr); } displayEventTabs(); updateSelectedEvents();