You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +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:
@@ -355,7 +355,7 @@ String BaseButton::get_tooltip(const Point2 &p_pos) const {
|
||||
String tooltip = Control::get_tooltip(p_pos);
|
||||
if (shortcut_in_tooltip && shortcut.is_valid() && shortcut->has_valid_event()) {
|
||||
String text = shortcut->get_name() + " (" + shortcut->get_as_text() + ")";
|
||||
if (tooltip != String() && shortcut->get_name().nocasecmp_to(tooltip) != 0) {
|
||||
if (!tooltip.is_empty() && shortcut->get_name().nocasecmp_to(tooltip) != 0) {
|
||||
text += "\n" + tooltip;
|
||||
}
|
||||
tooltip = text;
|
||||
|
||||
Reference in New Issue
Block a user