From 49403cbfa0399bb4284ea5c36cc90216a0bda6ff Mon Sep 17 00:00:00 2001 From: Nathan Franke Date: Thu, 9 Dec 2021 03:42:46 -0600 Subject: Replace String comparisons with "", String() to is_empty() Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings --- editor/import/dynamicfont_import_settings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'editor/import/dynamicfont_import_settings.cpp') diff --git a/editor/import/dynamicfont_import_settings.cpp b/editor/import/dynamicfont_import_settings.cpp index 83c0f56d87..b63c2bf350 100644 --- a/editor/import/dynamicfont_import_settings.cpp +++ b/editor/import/dynamicfont_import_settings.cpp @@ -1597,7 +1597,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { menu_langs = memnew(PopupMenu); menu_langs->set_name("Language"); - for (int i = 0; langs[i].name != String(); i++) { + for (int i = 0; !langs[i].name.is_empty(); i++) { if (langs[i].name == "-") { menu_langs->add_separator(); } else { @@ -1609,7 +1609,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { menu_scripts = memnew(PopupMenu); menu_scripts->set_name("Script"); - for (int i = 0; scripts[i].name != String(); i++) { + for (int i = 0; !scripts[i].name.is_empty(); i++) { if (scripts[i].name == "-") { menu_scripts->add_separator(); } else { @@ -1826,7 +1826,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { glyph_tree->connect("item_selected", callable_mp(this, &DynamicFontImportSettings::_range_selected)); glyph_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); glyph_root = glyph_tree->create_item(); - for (int i = 0; unicode_ranges[i].name != String(); i++) { + for (int i = 0; !unicode_ranges[i].name.is_empty(); i++) { _add_glyph_range_item(unicode_ranges[i].start, unicode_ranges[i].end, unicode_ranges[i].name); } -- cgit v1.2.3