Improve use of Ref.is_null/valid

Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
A Thousand Ships 2024-08-25 14:15:10 +02:00 committed by AThousandShips
parent 0f95e9f8e6
commit a1846b27ea
No known key found for this signature in database
GPG key ID: DEFC5A5B1306947D
177 changed files with 517 additions and 519 deletions

View file

@ -298,7 +298,7 @@ void GraphNode::draw_port(int p_slot_index, Point2i p_pos, bool p_left, const Co
Ref<Texture2D> port_icon = p_left ? slot.custom_port_icon_left : slot.custom_port_icon_right;
Point2 icon_offset;
if (!port_icon.is_valid()) {
if (port_icon.is_null()) {
port_icon = theme_cache.port;
}
@ -384,7 +384,7 @@ void GraphNode::set_slot(int p_slot_index, bool p_enable_left, int p_type_left,
if (!p_enable_left && p_type_left == 0 && p_color_left == Color(1, 1, 1, 1) &&
!p_enable_right && p_type_right == 0 && p_color_right == Color(1, 1, 1, 1) &&
!p_custom_left.is_valid() && !p_custom_right.is_valid()) {
p_custom_left.is_null() && p_custom_right.is_null()) {
slot_table.erase(p_slot_index);
return;
}