diff options
author | Lightning_A <aaronjrecord@gmail.com> | 2021-08-09 14:13:42 -0600 |
---|---|---|
committer | Lightning_A <aaronjrecord@gmail.com> | 2021-09-30 15:09:12 -0600 |
commit | c63b18507d21b8a213c073bced9057b571cdcd7a (patch) | |
tree | 96b8f7532ae5d923b75bfbac8d6763015b6646bb /core/input | |
parent | e4dfa69bcf58e4d50acdde32c590364e43fce3ab (diff) |
Use range iterators for `Map`
Diffstat (limited to 'core/input')
-rw-r--r-- | core/input/input.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp index 9195f7d8b5..05b02408a1 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -863,9 +863,9 @@ void Input::release_pressed_events() { joy_buttons_pressed.clear(); _joy_axis.clear(); - for (Map<StringName, Input::Action>::Element *E = action_state.front(); E; E = E->next()) { - if (E->get().pressed) { - action_release(E->key()); + for (const KeyValue<StringName, Input::Action> &E : action_state) { + if (E.value.pressed) { + action_release(E.key); } } } @@ -1322,8 +1322,8 @@ void Input::add_joy_mapping(String p_mapping, bool p_update_existing) { if (p_update_existing) { Vector<String> entry = p_mapping.split(","); String uid = entry[0]; - for (Map<int, Joypad>::Element *E = joy_names.front(); E; E = E->next()) { - Joypad &joy = E->get(); + for (KeyValue<int, Joypad> &E : joy_names) { + Joypad &joy = E.value; if (joy.uid == uid) { joy.mapping = map_db.size() - 1; } @@ -1337,8 +1337,8 @@ void Input::remove_joy_mapping(String p_guid) { map_db.remove(i); } } - for (Map<int, Joypad>::Element *E = joy_names.front(); E; E = E->next()) { - Joypad &joy = E->get(); + for (KeyValue<int, Joypad> &E : joy_names) { + Joypad &joy = E.value; if (joy.uid == p_guid) { joy.mapping = -1; } |