mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-31 00:32:53 +00:00
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);
|
std::lock_guard lock(storage.m_mutex);
|
||||||
|
|
||||||
DEBUG_LOG_FMT(COMMON, "Registering {} handler at {} event hook", name, EventName.value);
|
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());
|
storage.m_listeners.push_back(handle.get());
|
||||||
return handle;
|
return handle;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user