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/io/file_access.cpp | |
parent | 31ded7e126b9d71ed8dddab9ffc1ce813f1a8ec2 (diff) | |
download | redot-engine-49403cbfa0399bb4284ea5c36cc90216a0bda6ff.tar.gz |
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/io/file_access.cpp')
-rw-r--r-- | core/io/file_access.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/file_access.cpp b/core/io/file_access.cpp index e6e79dff8a..1b9c43b155 100644 --- a/core/io/file_access.cpp +++ b/core/io/file_access.cpp @@ -127,7 +127,7 @@ String FileAccess::fix_path(const String &p_path) const { if (ProjectSettings::get_singleton()) { if (r_path.begins_with("res://")) { String resource_path = ProjectSettings::get_singleton()->get_resource_path(); - if (resource_path != "") { + if (!resource_path.is_empty()) { return r_path.replace("res:/", resource_path); } return r_path.replace("res://", ""); @@ -138,7 +138,7 @@ String FileAccess::fix_path(const String &p_path) const { case ACCESS_USERDATA: { if (r_path.begins_with("user://")) { String data_dir = OS::get_singleton()->get_user_data_dir(); - if (data_dir != "") { + if (!data_dir.is_empty()) { return r_path.replace("user:/", data_dir); } return r_path.replace("user://", ""); |