From a92dbec96242fe246de99878b12e217b3087463e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 13 Dec 2021 09:23:19 -0500 Subject: input_engine: std::move InputIdentifier in SetCallback() Allows avoiding std::function allocations. --- src/input_common/input_engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/input_common/input_engine.cpp') diff --git a/src/input_common/input_engine.cpp b/src/input_common/input_engine.cpp index 2b2105376..6b057e2f1 100644 --- a/src/input_common/input_engine.cpp +++ b/src/input_common/input_engine.cpp @@ -342,7 +342,7 @@ const std::string& InputEngine::GetEngineName() const { int InputEngine::SetCallback(InputIdentifier input_identifier) { 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++; } -- cgit v1.2.3