mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +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:
parent
31ded7e126
commit
49403cbfa0
226 changed files with 1051 additions and 1034 deletions
|
|
@ -460,11 +460,11 @@ int OS_Unix::get_processor_count() const {
|
|||
|
||||
String OS_Unix::get_user_data_dir() const {
|
||||
String appname = get_safe_dir_name(ProjectSettings::get_singleton()->get("application/config/name"));
|
||||
if (appname != "") {
|
||||
if (!appname.is_empty()) {
|
||||
bool use_custom_dir = ProjectSettings::get_singleton()->get("application/config/use_custom_user_dir");
|
||||
if (use_custom_dir) {
|
||||
String custom_dir = get_safe_dir_name(ProjectSettings::get_singleton()->get("application/config/custom_user_dir_name"), true);
|
||||
if (custom_dir == "") {
|
||||
if (custom_dir.is_empty()) {
|
||||
custom_dir = appname;
|
||||
}
|
||||
return get_data_path().plus_file(custom_dir);
|
||||
|
|
@ -486,7 +486,7 @@ String OS_Unix::get_executable_path() const {
|
|||
if (len > 0) {
|
||||
b.parse_utf8(buf, len);
|
||||
}
|
||||
if (b == "") {
|
||||
if (b.is_empty()) {
|
||||
WARN_PRINT("Couldn't get executable path from /proc/self/exe, using argv[0]");
|
||||
return OS::get_executable_path();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue