mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03: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
|
@ -1307,7 +1307,7 @@ void VisualScriptVariableGet::_validate_property(PropertyInfo &property) const {
|
|||
|
||||
String vhint;
|
||||
for (const StringName &E : vars) {
|
||||
if (vhint != String()) {
|
||||
if (!vhint.is_empty()) {
|
||||
vhint += ",";
|
||||
}
|
||||
|
||||
|
@ -1417,7 +1417,7 @@ void VisualScriptVariableSet::_validate_property(PropertyInfo &property) const {
|
|||
|
||||
String vhint;
|
||||
for (const StringName &E : vars) {
|
||||
if (vhint != String()) {
|
||||
if (!vhint.is_empty()) {
|
||||
vhint += ",";
|
||||
}
|
||||
|
||||
|
@ -1615,7 +1615,7 @@ PropertyInfo VisualScriptPreload::get_output_value_port_info(int p_idx) const {
|
|||
pinfo.hint_string = preload->get_class();
|
||||
if (preload->get_path().is_resource_file()) {
|
||||
pinfo.name = preload->get_path();
|
||||
} else if (preload->get_name() != String()) {
|
||||
} else if (!preload->get_name().is_empty()) {
|
||||
pinfo.name = preload->get_name();
|
||||
} else {
|
||||
pinfo.name = preload->get_class();
|
||||
|
@ -1994,7 +1994,7 @@ void VisualScriptClassConstant::_validate_property(PropertyInfo &property) const
|
|||
|
||||
property.hint_string = "";
|
||||
for (const String &E : constants) {
|
||||
if (property.hint_string != String()) {
|
||||
if (!property.hint_string.is_empty()) {
|
||||
property.hint_string += ",";
|
||||
}
|
||||
property.hint_string += E;
|
||||
|
@ -2132,7 +2132,7 @@ void VisualScriptBasicTypeConstant::_validate_property(PropertyInfo &property) c
|
|||
}
|
||||
property.hint_string = "";
|
||||
for (const StringName &E : constants) {
|
||||
if (property.hint_string != String()) {
|
||||
if (!property.hint_string.is_empty()) {
|
||||
property.hint_string += ",";
|
||||
}
|
||||
property.hint_string += String(E);
|
||||
|
@ -2363,7 +2363,7 @@ void VisualScriptEngineSingleton::_validate_property(PropertyInfo &property) con
|
|||
continue; //skip these, too simple named
|
||||
}
|
||||
|
||||
if (cc != String()) {
|
||||
if (!cc.is_empty()) {
|
||||
cc += ",";
|
||||
}
|
||||
cc += E.name;
|
||||
|
@ -3147,7 +3147,7 @@ String VisualScriptSubCall::get_caption() const {
|
|||
String VisualScriptSubCall::get_text() const {
|
||||
Ref<Script> script = get_script();
|
||||
if (script.is_valid()) {
|
||||
if (script->get_name() != String()) {
|
||||
if (!script->get_name().is_empty()) {
|
||||
return script->get_name();
|
||||
}
|
||||
if (script->get_path().is_resource_file()) {
|
||||
|
@ -3786,7 +3786,7 @@ void VisualScriptInputAction::_validate_property(PropertyInfo &property) const {
|
|||
al.sort();
|
||||
|
||||
for (int i = 0; i < al.size(); i++) {
|
||||
if (actions != String()) {
|
||||
if (!actions.is_empty()) {
|
||||
actions += ",";
|
||||
}
|
||||
actions += al[i];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue