1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

[Core,Drivers] 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:13:44 +02:00
parent c6c464cf9a
commit ec650a2f09
14 changed files with 39 additions and 39 deletions

View File

@@ -940,7 +940,7 @@ void Object::set_script(const Variant &p_script) {
script_instance = nullptr;
}
if (!s.is_null()) {
if (s.is_valid()) {
if (s->can_instantiate()) {
OBJ_DEBUG_LOCK
script_instance = s->instance_create(this);
@@ -1579,7 +1579,7 @@ void Object::_clear_internal_resource_paths(const Variant &p_var) {
switch (p_var.get_type()) {
case Variant::OBJECT: {
Ref<Resource> r = p_var;
if (!r.is_valid()) {
if (r.is_null()) {
return;
}