1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +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:
Nathan Franke
2021-12-09 03:42:46 -06:00
parent 31ded7e126
commit 49403cbfa0
226 changed files with 1051 additions and 1034 deletions

View File

@@ -52,7 +52,7 @@ Size2 Button::get_minimum_size() const {
if (icon_alignment != HORIZONTAL_ALIGNMENT_CENTER) {
minsize.width += _icon->get_width();
if (xl_text != "") {
if (!xl_text.is_empty()) {
minsize.width += get_theme_constant(SNAME("hseparation"));
}
} else {
@@ -359,7 +359,7 @@ void Button::_shape() {
} else {
text_buf->set_direction((TextServer::Direction)text_direction);
}
text_buf->add_string(xl_text, font, font_size, opentype_features, (language != "") ? language : TranslationServer::get_singleton()->get_tool_locale());
text_buf->add_string(xl_text, font, font_size, opentype_features, (!language.is_empty()) ? language : TranslationServer::get_singleton()->get_tool_locale());
}
void Button::set_text(const String &p_text) {