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/visual_script/visual_script.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/visual_script/visual_script.cpp') diff --git a/modules/visual_script/visual_script.cpp b/modules/visual_script/visual_script.cpp index 34d8c0b1e6..63bd9bbee4 100644 --- a/modules/visual_script/visual_script.cpp +++ b/modules/visual_script/visual_script.cpp @@ -1665,8 +1665,8 @@ Variant VisualScriptInstance::_call_internal(const StringName &p_method, void *p String err_func = p_method; int err_line = current_node_id; // Not a line but it works as one. - if (node && (r_error.error != Callable::CallError::CALL_ERROR_INVALID_METHOD || error_str == String())) { - if (error_str != String()) { + if (node && (r_error.error != Callable::CallError::CALL_ERROR_INVALID_METHOD || error_str.is_empty())) { + if (!error_str.is_empty()) { error_str += " "; } @@ -2379,7 +2379,7 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level, Listinput_port_count; i++) { String name = node->get_base_node()->get_input_value_port_info(i).name; - if (name == String()) { + if (name.is_empty()) { name = "in_" + itos(i); } @@ -2399,7 +2399,7 @@ void VisualScriptLanguage::debug_get_stack_level_locals(int p_level, Listoutput_port_count; i++) { String name = node->get_base_node()->get_output_value_port_info(i).name; - if (name == String()) { + if (name.is_empty()) { name = "out_" + itos(i); } -- cgit v1.2.3