You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +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:
@@ -242,7 +242,7 @@ Button *AcceptDialog::add_button(const String &p_text, bool p_right, const Strin
|
||||
hbc->add_spacer(true);
|
||||
}
|
||||
|
||||
if (p_action != "") {
|
||||
if (!p_action.is_empty()) {
|
||||
button->connect("pressed", callable_mp(this, &AcceptDialog::_custom_action), varray(p_action));
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ Button *AcceptDialog::add_button(const String &p_text, bool p_right, const Strin
|
||||
|
||||
Button *AcceptDialog::add_cancel_button(const String &p_cancel) {
|
||||
String c = p_cancel;
|
||||
if (p_cancel == "") {
|
||||
if (p_cancel.is_empty()) {
|
||||
c = TTRC("Cancel");
|
||||
}
|
||||
Button *b = swap_cancel_ok ? add_button(c, true) : add_button(c);
|
||||
|
||||
Reference in New Issue
Block a user