From 6b5f56532451631b63a57ca858dabc111b05711b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 26 Oct 2020 19:36:58 -0400 Subject: controller: Pass ControllerParameters by reference in ReconfigureControllers() Prevents unnecessary copies and heap reallocations from occurring. --- src/core/frontend/applets/controller.cpp | 2 +- src/core/frontend/applets/controller.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/frontend/applets/controller.cpp b/src/core/frontend/applets/controller.cpp index c5d65f2d0..5582091f4 100644 --- a/src/core/frontend/applets/controller.cpp +++ b/src/core/frontend/applets/controller.cpp @@ -19,7 +19,7 @@ DefaultControllerApplet::DefaultControllerApplet(Service::SM::ServiceManager& se DefaultControllerApplet::~DefaultControllerApplet() = default; void DefaultControllerApplet::ReconfigureControllers(std::function callback, - ControllerParameters parameters) const { + const ControllerParameters& parameters) const { LOG_INFO(Service_HID, "called, deducing the best configuration based on the given parameters!"); auto& npad = diff --git a/src/core/frontend/applets/controller.h b/src/core/frontend/applets/controller.h index 3e49cdbb9..dff71d8d9 100644 --- a/src/core/frontend/applets/controller.h +++ b/src/core/frontend/applets/controller.h @@ -38,7 +38,7 @@ public: virtual ~ControllerApplet(); virtual void ReconfigureControllers(std::function callback, - ControllerParameters parameters) const = 0; + const ControllerParameters& parameters) const = 0; }; class DefaultControllerApplet final : public ControllerApplet { @@ -47,7 +47,7 @@ public: ~DefaultControllerApplet() override; void ReconfigureControllers(std::function callback, - ControllerParameters parameters) const override; + const ControllerParameters& parameters) const override; private: Service::SM::ServiceManager& service_manager; -- cgit v1.2.3