mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 08:23:29 +00:00
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:
parent
31ded7e126
commit
49403cbfa0
226 changed files with 1051 additions and 1034 deletions
|
@ -724,7 +724,7 @@ String VisualScriptTypeCast::get_caption() const {
|
|||
}
|
||||
|
||||
String VisualScriptTypeCast::get_text() const {
|
||||
if (script != String()) {
|
||||
if (!script.is_empty()) {
|
||||
return "Is " + script.get_file() + "?";
|
||||
} else {
|
||||
return "Is " + base_type + "?";
|
||||
|
@ -762,7 +762,7 @@ String VisualScriptTypeCast::get_base_script() const {
|
|||
VisualScriptTypeCast::TypeGuess VisualScriptTypeCast::guess_output_type(TypeGuess *p_inputs, int p_output) const {
|
||||
TypeGuess tg;
|
||||
tg.type = Variant::OBJECT;
|
||||
if (script != String()) {
|
||||
if (!script.is_empty()) {
|
||||
tg.script = ResourceLoader::load(script);
|
||||
}
|
||||
//if (!tg.script.is_valid()) {
|
||||
|
@ -793,7 +793,7 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (script != String()) {
|
||||
if (!script.is_empty()) {
|
||||
Ref<Script> obj_script = obj->get_script();
|
||||
if (!obj_script.is_valid()) {
|
||||
return 1; //well, definitely not the script because object we got has no script.
|
||||
|
@ -853,7 +853,7 @@ void VisualScriptTypeCast::_bind_methods() {
|
|||
|
||||
String script_ext_hint;
|
||||
for (const String &E : script_extensions) {
|
||||
if (script_ext_hint != String()) {
|
||||
if (!script_ext_hint.is_empty()) {
|
||||
script_ext_hint += ",";
|
||||
}
|
||||
script_ext_hint += "*." + E;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue