Commit de081e12 authored by Philipp Schafft's avatar Philipp Schafft 🦁
Browse files

Update: Avoid running igloo_RO_TO_TYPE_raw() too many times for no reason in...

Update: Avoid running igloo_RO_TO_TYPE_raw() too many times for no reason in igloo_ro_get_instance_unsafe()
parent 5e1611d0
Pipeline #3000 failed with stages
in 4 minutes and 44 seconds
......@@ -973,17 +973,23 @@ igloo_error_t igloo_ro_bootstrap(igloo_ro_t *instance, const igloo_ro_type_t *ty
igloo_ro_t igloo_ro_get_instance_unsafe(igloo_ro_t self, const igloo_ro_type_t *type)
{
igloo_ro_t ret;
igloo_ro_stub_t *stub;
if (!is_valid_object(self))
return igloo_RO_NULL;
ret = igloo_RO_TO_TYPE_raw(self, type);
if (!igloo_ro_is_null(ret))
return ret;
stub = igloo_RO__GETSTUB(self);
if (is_object_of_type(self, type)) {
if (stub->refc) {
return self;
} else {
return igloo_RO_NULL;
}
}
if (!igloo_RO__GETSTUB(self)->group)
if (!stub->group)
return igloo_RO_NULL;
return igloo_RO_TO_TYPE_raw(igloo_RO__GETSTUB(self)->group->instance, type);
return igloo_RO_TO_TYPE_raw(stub->group->instance, type);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment