diff options
author | Hein-Pieter van Braam <hp@tmm.cx> | 2018-07-26 01:26:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-26 01:26:46 +0200 |
commit | 832e2bfcd38965a01a9149d509169dd197e42f58 (patch) | |
tree | 18b7ff35f1eeee39031a16e9c1d834ebf03d44cf /main/input_default.cpp | |
parent | 9423f23ffb80c946dec380f73f3f313ec44d0d18 (diff) | |
parent | 0e29f7974b59e4440cf02e1388fb9d8ab2b5c5fd (diff) |
Merge pull request #20137 from hpvb/reduce-vector-cow
Reduce unnecessary COW on Vector by make writing explicit
Diffstat (limited to 'main/input_default.cpp')
-rw-r--r-- | main/input_default.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/main/input_default.cpp b/main/input_default.cpp index 29d30110e3..4363fc1c88 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -684,7 +684,7 @@ void InputDefault::joy_button(int p_device, int p_button, bool p_pressed) { return; }; - Map<int, JoyEvent>::Element *el = map_db[joy.mapping].buttons.find(p_button); + const Map<int, JoyEvent>::Element *el = map_db[joy.mapping].buttons.find(p_button); if (!el) { //don't process un-mapped events for now, it could mess things up badly for devices with additional buttons/axis //return _button_event(p_last_id, p_device, p_button, p_pressed); @@ -755,7 +755,7 @@ void InputDefault::joy_axis(int p_device, int p_axis, const JoyAxis &p_value) { return; }; - Map<int, JoyEvent>::Element *el = map_db[joy.mapping].axis.find(p_axis); + const Map<int, JoyEvent>::Element *el = map_db[joy.mapping].axis.find(p_axis); if (!el) { //return _axis_event(p_last_id, p_device, p_axis, p_value); return; @@ -831,7 +831,7 @@ void InputDefault::joy_hat(int p_device, int p_val) { _THREAD_SAFE_METHOD_; const Joypad &joy = joy_names[p_device]; - JoyEvent *map; + const JoyEvent *map; if (joy.mapping == -1) { map = hat_map_default; |