Common/HookableEvent: std::move callback instance in Register()

Potentially avoids reallocations if the capture buffer of the callback
is quite large.
This commit is contained in:
Lioncash 2024-01-31 13:16:48 -05:00
parent cac66317aa
commit 16d8b6e6b3
1 changed files with 1 additions and 1 deletions

View File

@ -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<HookImpl>(callback, std::move(name));
auto handle = std::make_unique<HookImpl>(std::move(callback), std::move(name));
storage.m_listeners.push_back(handle.get());
return handle;
}