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 /platform/javascript | |
parent | 31ded7e126b9d71ed8dddab9ffc1ce813f1a8ec2 (diff) |
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 'platform/javascript')
-rw-r--r-- | platform/javascript/export/export_plugin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/javascript/export/export_plugin.cpp b/platform/javascript/export/export_plugin.cpp index 018dd3b664..9733435584 100644 --- a/platform/javascript/export/export_plugin.cpp +++ b/platform/javascript/export/export_plugin.cpp @@ -380,7 +380,7 @@ bool EditorExportPlatformJavaScript::can_export(const Ref<EditorExportPreset> &p if (p_preset->get("vram_texture_compression/for_mobile")) { String etc_error = test_etc2(); - if (etc_error != String()) { + if (!etc_error.is_empty()) { valid = false; err += etc_error; } @@ -415,7 +415,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese // Find the correct template String template_path = p_debug ? custom_debug : custom_release; template_path = template_path.strip_edges(); - if (template_path == String()) { + if (template_path.is_empty()) { ExportMode mode = (ExportMode)(int)p_preset->get("variant/export_type"); template_path = find_export_template(_get_template_name(mode, p_debug)); } @@ -424,7 +424,7 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese return ERR_FILE_BAD_PATH; } - if (template_path != String() && !FileAccess::exists(template_path)) { + if (!template_path.is_empty() && !FileAccess::exists(template_path)) { EditorNode::get_singleton()->show_warning(TTR("Template file not found:") + "\n" + template_path); return ERR_FILE_NOT_FOUND; } |