1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

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
177 changed files with 517 additions and 519 deletions

View File

@@ -114,7 +114,7 @@ bool CreateDialog::_is_type_preferred(const String &p_type) const {
bool CreateDialog::_is_class_disabled_by_feature_profile(const StringName &p_class) const {
Ref<EditorFeatureProfile> profile = EditorFeatureProfileManager::get_singleton()->get_current_profile();
return !profile.is_null() && profile->is_class_disabled(p_class);
return profile.is_valid() && profile->is_class_disabled(p_class);
}
bool CreateDialog::_should_hide_type(const StringName &p_type) const {
@@ -312,7 +312,7 @@ void CreateDialog::_configure_search_option_item(TreeItem *r_item, const StringN
r_item->set_suffix(0, "(" + suffix + ")");
}
ERR_FAIL_COND(!scr.is_valid());
ERR_FAIL_COND(scr.is_null());
is_abstract = scr->is_abstract();
} else {
r_item->set_metadata(0, custom_type_parents[p_type]);