From 7e6ef060c63715e5df235f7364368713821c4bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 25 Oct 2024 21:08:01 +0200 Subject: [PATCH] Small UI event processing optimization. Helps debugging more than performance. --- Common/UI/View.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Common/UI/View.cpp b/Common/UI/View.cpp index ab39d45bd6..f7e8959a93 100644 --- a/Common/UI/View.cpp +++ b/Common/UI/View.cpp @@ -72,6 +72,9 @@ void Event::Add(std::function func) { // Call this from input thread or whatever, it doesn't matter void Event::Trigger(EventParams &e) { + if (handlers_.empty()) { + return; + } EventTriggered(this, e); }