perf(obj): return directly if parent is unchanged (#6283)

Signed-off-by: Neo Xu <neo.xu1990@gmail.com>
This commit is contained in:
Neo Xu
2024-05-27 19:52:01 +08:00
committed by GitHub
parent 340fee4106
commit ba3afe6fc1
+4
View File
@@ -154,6 +154,10 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent)
return;
}
if(parent == obj->parent) {
return;
}
lv_obj_invalidate(obj);
lv_obj_allocate_spec_attr(parent);