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:
@ -606,7 +606,7 @@ String OS_Windows::get_locale() const {
|
||||
wl++;
|
||||
}
|
||||
|
||||
if (neutral != "")
|
||||
if (!neutral.is_empty())
|
||||
return String(neutral).replace("-", "_");
|
||||
|
||||
return "en";
|
||||
@ -757,11 +757,11 @@ String OS_Windows::get_system_dir(SystemDir p_dir, bool p_shared_storage) const
|
||||
|
||||
String OS_Windows::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).replace("\\", "/");
|
||||
|
||||
Reference in New Issue
Block a user