diff options
| author | 2022-12-05 18:11:17 -0500 | |
|---|---|---|
| committer | 2022-12-05 18:15:19 -0500 | |
| commit | 4255e30722ff000a8dc15c1842cee014cdc32291 (patch) | |
| tree | 3127dc6d4495dcf5b00eb246192ddac81801123c /src | |
| parent | Merge pull request #6833 from abouvier/unbundle (diff) | |
| download | yuzu-4255e30722ff000a8dc15c1842cee014cdc32291.tar.gz yuzu-4255e30722ff000a8dc15c1842cee014cdc32291.tar.xz yuzu-4255e30722ff000a8dc15c1842cee014cdc32291.zip | |
emulated_console: std::move() ParamPackages and callbacks where applicable
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hid/emulated_console.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/hid/emulated_console.cpp b/src/core/hid/emulated_console.cpp index b6c8cc58d..a896a5ad8 100644 --- a/src/core/hid/emulated_console.cpp +++ b/src/core/hid/emulated_console.cpp | |||
| @@ -37,7 +37,7 @@ void EmulatedConsole::SetTouchParams() { | |||
| 37 | touchscreen_param.Set("axis_x", i * 2); | 37 | touchscreen_param.Set("axis_x", i * 2); |
| 38 | touchscreen_param.Set("axis_y", (i * 2) + 1); | 38 | touchscreen_param.Set("axis_y", (i * 2) + 1); |
| 39 | touchscreen_param.Set("button", i); | 39 | touchscreen_param.Set("button", i); |
| 40 | touch_params[index++] = touchscreen_param; | 40 | touch_params[index++] = std::move(touchscreen_param); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | const auto button_index = | 43 | const auto button_index = |
| @@ -59,7 +59,7 @@ void EmulatedConsole::SetTouchParams() { | |||
| 59 | touch_button_params.Set("button", params.Serialize()); | 59 | touch_button_params.Set("button", params.Serialize()); |
| 60 | touch_button_params.Set("x", x); | 60 | touch_button_params.Set("x", x); |
| 61 | touch_button_params.Set("y", y); | 61 | touch_button_params.Set("y", y); |
| 62 | touch_params[index] = touch_button_params; | 62 | touch_params[index] = std::move(touch_button_params); |
| 63 | index++; | 63 | index++; |
| 64 | } | 64 | } |
| 65 | } | 65 | } |
| @@ -131,7 +131,7 @@ Common::ParamPackage EmulatedConsole::GetMotionParam() const { | |||
| 131 | } | 131 | } |
| 132 | 132 | ||
| 133 | void EmulatedConsole::SetMotionParam(Common::ParamPackage param) { | 133 | void EmulatedConsole::SetMotionParam(Common::ParamPackage param) { |
| 134 | motion_params = param; | 134 | motion_params = std::move(param); |
| 135 | ReloadInput(); | 135 | ReloadInput(); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| @@ -284,7 +284,7 @@ void EmulatedConsole::TriggerOnChange(ConsoleTriggerType type) { | |||
| 284 | 284 | ||
| 285 | int EmulatedConsole::SetCallback(ConsoleUpdateCallback update_callback) { | 285 | int EmulatedConsole::SetCallback(ConsoleUpdateCallback update_callback) { |
| 286 | std::scoped_lock lock{callback_mutex}; | 286 | std::scoped_lock lock{callback_mutex}; |
| 287 | callback_list.insert_or_assign(last_callback_key, update_callback); | 287 | callback_list.insert_or_assign(last_callback_key, std::move(update_callback)); |
| 288 | return last_callback_key++; | 288 | return last_callback_key++; |
| 289 | } | 289 | } |
| 290 | 290 | ||