diff options
| author | 2022-11-28 09:11:56 -0500 | |
|---|---|---|
| committer | 2022-11-28 09:11:58 -0500 | |
| commit | 7f42432f4205185f474733335c8a4eef26992454 (patch) | |
| tree | 9360aa8516390fabc700e8acbf309f48cf4d59d1 /src | |
| parent | Merge pull request #9325 from german77/default_by_default (diff) | |
| download | yuzu-7f42432f4205185f474733335c8a4eef26992454.tar.gz yuzu-7f42432f4205185f474733335c8a4eef26992454.tar.xz yuzu-7f42432f4205185f474733335c8a4eef26992454.zip | |
common/input: Pass ParamPackage by const reference in CreateDevice
This was previously being passed by value, which was unnecessary and
created more allocations than necessary.
Diffstat (limited to '')
| -rw-r--r-- | src/common/input.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/input.h b/src/common/input.h index cb30b7254..4030ad2e5 100644 --- a/src/common/input.h +++ b/src/common/input.h | |||
| @@ -417,12 +417,12 @@ std::unique_ptr<InputDeviceType> CreateDeviceFromString(const std::string& param | |||
| 417 | } | 417 | } |
| 418 | 418 | ||
| 419 | /** | 419 | /** |
| 420 | * Create an input device from given paramters. | 420 | * Create an input device from given parameters. |
| 421 | * @tparam InputDeviceType the type of input devices to create | 421 | * @tparam InputDeviceType the type of input devices to create |
| 422 | * @param A ParamPackage that contains all parameters for creating the device | 422 | * @param package A ParamPackage that contains all parameters for creating the device |
| 423 | */ | 423 | */ |
| 424 | template <typename InputDeviceType> | 424 | template <typename InputDeviceType> |
| 425 | std::unique_ptr<InputDeviceType> CreateDevice(const Common::ParamPackage package) { | 425 | std::unique_ptr<InputDeviceType> CreateDevice(const ParamPackage& package) { |
| 426 | const std::string engine = package.Get("engine", "null"); | 426 | const std::string engine = package.Get("engine", "null"); |
| 427 | const auto& factory_list = Impl::FactoryList<InputDeviceType>::list; | 427 | const auto& factory_list = Impl::FactoryList<InputDeviceType>::list; |
| 428 | const auto pair = factory_list.find(engine); | 428 | const auto pair = factory_list.find(engine); |