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:
parent
cac66317aa
commit
16d8b6e6b3
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue