From 49403cbfa0399bb4284ea5c36cc90216a0bda6ff Mon Sep 17 00:00:00 2001 From: Nathan Franke Date: Thu, 9 Dec 2021 03:42:46 -0600 Subject: Replace String comparisons with "", String() to is_empty() Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings --- core/input/input_map.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/input/input_map.cpp') 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>> &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>> &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; } -- cgit v1.2.3