You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Replace String comparisons with "", String() to is_empty()
Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
This commit is contained in:
@@ -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://", "");
|
||||
|
||||
Reference in New Issue
Block a user