From 16d8b6e6b3af87e5d7684bf34ca79b765ff44d33 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 31 Jan 2024 13:16:48 -0500 Subject: [PATCH] Common/HookableEvent: std::move callback instance in Register() Potentially avoids reallocations if the capture buffer of the callback is quite large. --- Source/Core/Common/HookableEvent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/HookableEvent.h b/Source/Core/Common/HookableEvent.h index be97a8ab9b..987880de98 100644 --- a/Source/Core/Common/HookableEvent.h +++ b/Source/Core/Common/HookableEvent.h @@ -97,7 +97,7 @@ public: std::lock_guard lock(storage.m_mutex); DEBUG_LOG_FMT(COMMON, "Registering {} handler at {} event hook", name, EventName.value); - auto handle = std::make_unique(callback, std::move(name)); + auto handle = std::make_unique(std::move(callback), std::move(name)); storage.m_listeners.push_back(handle.get()); return handle; }