mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-26 16:52:46 +01:00
input_engine: std::move InputIdentifier in SetCallback()
Allows avoiding std::function allocations.
This commit is contained in:
parent
985599e485
commit
a92dbec962
1 changed files with 1 additions and 1 deletions
|
@ -342,7 +342,7 @@ const std::string& InputEngine::GetEngineName() const {
|
||||||
|
|
||||||
int InputEngine::SetCallback(InputIdentifier input_identifier) {
|
int InputEngine::SetCallback(InputIdentifier input_identifier) {
|
||||||
std::lock_guard lock{mutex_callback};
|
std::lock_guard lock{mutex_callback};
|
||||||
callback_list.insert_or_assign(last_callback_key, input_identifier);
|
callback_list.insert_or_assign(last_callback_key, std::move(input_identifier));
|
||||||
return last_callback_key++;
|
return last_callback_key++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue