From 755822ceecf2a261a09f486706955bebc23d3917 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 13 Dec 2021 09:26:44 -0500 Subject: input_engine: Take BasicMotion by const reference with SetMotion() and TriggerOnMotionChange() Copies the BasicMotion instance once instead of twice. --- src/input_common/drivers/sdl_driver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/input_common/drivers/sdl_driver.cpp') diff --git a/src/input_common/drivers/sdl_driver.cpp b/src/input_common/drivers/sdl_driver.cpp index a9219dbf2..e33a5ff31 100644 --- a/src/input_common/drivers/sdl_driver.cpp +++ b/src/input_common/drivers/sdl_driver.cpp @@ -88,7 +88,7 @@ public: return true; } - BasicMotion GetMotion() { + const BasicMotion& GetMotion() const { return motion; } @@ -367,7 +367,7 @@ void SDLDriver::HandleGameControllerEvent(const SDL_Event& event) { if (joystick->UpdateMotion(event.csensor)) { const PadIdentifier identifier = joystick->GetPadIdentifier(); SetMotion(identifier, 0, joystick->GetMotion()); - }; + } } break; } -- cgit v1.2.3