diff options
author | Nathan Franke <natfra@pm.me> | 2021-12-09 03:42:46 -0600 |
---|---|---|
committer | Nathan Franke <natfra@pm.me> | 2021-12-09 04:48:38 -0600 |
commit | 49403cbfa0399bb4284ea5c36cc90216a0bda6ff (patch) | |
tree | caa6c7249d35d83b288a180a4f5d7e4fd959704f /core/input/input_map.cpp | |
parent | 31ded7e126b9d71ed8dddab9ffc1ce813f1a8ec2 (diff) |
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
Diffstat (limited to 'core/input/input_map.cpp')
-rw-r--r-- | core/input/input_map.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/input/input_map.cpp b/core/input/input_map.cpp index 84e1313756..183a2c3e68 100644 --- a/core/input/input_map.cpp +++ b/core/input/input_map.cpp @@ -718,7 +718,7 @@ const OrderedHashMap<String, List<Ref<InputEvent>>> &InputMap::get_builtins_with String name = split[0]; String override_for = split.size() > 1 ? split[1] : String(); - if (override_for != String() && OS::get_singleton()->has_feature(override_for)) { + if (!override_for.is_empty() && OS::get_singleton()->has_feature(override_for)) { builtins_with_overrides[name].push_back(override_for); } } @@ -730,12 +730,12 @@ const OrderedHashMap<String, List<Ref<InputEvent>>> &InputMap::get_builtins_with String name = split[0]; String override_for = split.size() > 1 ? split[1] : String(); - if (builtins_with_overrides.has(name) && override_for == String()) { + if (builtins_with_overrides.has(name) && override_for.is_empty()) { // Builtin has an override but this particular one is not an override, so skip. continue; } - if (override_for != String() && !OS::get_singleton()->has_feature(override_for)) { + if (!override_for.is_empty() && !OS::get_singleton()->has_feature(override_for)) { // OS does not support this override - skip. continue; } |