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 --- modules/fbx/data/fbx_material.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/fbx/data/fbx_material.cpp') diff --git a/modules/fbx/data/fbx_material.cpp b/modules/fbx/data/fbx_material.cpp index 86baec4244..26c9ef8d54 100644 --- a/modules/fbx/data/fbx_material.cpp +++ b/modules/fbx/data/fbx_material.cpp @@ -60,7 +60,7 @@ String find_file(const String &p_base, const String &p_file_to_find) { dir.list_dir_begin(); String n = dir.get_next(); - while (n != String()) { + while (!n.is_empty()) { if (n == "." || n == "..") { n = dir.get_next(); continue; @@ -68,7 +68,7 @@ String find_file(const String &p_base, const String &p_file_to_find) { if (dir.current_is_dir()) { // Don't use `path_to` or the returned path will be wrong. const String f = find_file(p_base + "/" + n, p_file_to_find); - if (f != "") { + if (!f.is_empty()) { return f; } } else if (n == p_file_to_find) { @@ -119,7 +119,7 @@ String FBXMaterial::find_texture_path_by_filename(const String p_filename, const dir.open("res://"); dir.list_dir_begin(); String n = dir.get_next(); - while (n != String()) { + while (!n.is_empty()) { if (n == "." || n == "..") { n = dir.get_next(); continue; @@ -136,7 +136,7 @@ String FBXMaterial::find_texture_path_by_filename(const String p_filename, const lower_n.find("picture") >= 0) { // Don't use `path_to` or the returned path will be wrong. const String f = find_file(String("res://") + n, p_filename); - if (f != "") { + if (!f.is_empty()) { return f; } } -- cgit v1.2.3