summaryrefslogtreecommitdiff
path: root/core/input
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-07-24 15:46:25 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-07-25 12:22:25 +0200
commitac3322b0af8f23e8e2dac8111200bc69b5604c9f (patch)
tree59a079f13b5c03c2dd3328a26c55f3618e6014f6 /core/input
parenta0f7f42b842462646281f5c4c9a8db070e034adc (diff)
Use const references where possible for List range iterators
Diffstat (limited to 'core/input')
-rw-r--r--core/input/input.cpp2
-rw-r--r--core/input/input_map.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/core/input/input.cpp b/core/input/input.cpp
index e30e7c814f..c205726b0a 100644
--- a/core/input/input.cpp
+++ b/core/input/input.cpp
@@ -174,7 +174,7 @@ void Input::get_argument_options(const StringName &p_function, int p_idx, List<S
List<PropertyInfo> pinfo;
ProjectSettings::get_singleton()->get_property_list(&pinfo);
- for (PropertyInfo &pi : pinfo) {
+ for (const PropertyInfo &pi : pinfo) {
if (!pi.name.begins_with("input/")) {
continue;
}
diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp
index 0c8705b263..6714705bb5 100644
--- a/core/input/input_map.cpp
+++ b/core/input/input_map.cpp
@@ -65,7 +65,7 @@ String InputMap::_suggest_actions(const StringName &p_action) const {
float closest_similarity = 0.0;
// Find the most action with the most similar name.
- for (StringName &action : actions) {
+ for (const StringName &action : actions) {
const float similarity = String(action).similarity(p_action);
if (similarity > closest_similarity) {
@@ -261,7 +261,7 @@ void InputMap::load_from_project_settings() {
List<PropertyInfo> pinfo;
ProjectSettings::get_singleton()->get_property_list(&pinfo);
- for (PropertyInfo &pi : pinfo) {
+ for (const PropertyInfo &pi : pinfo) {
if (!pi.name.begins_with("input/")) {
continue;
}