[IMP] app: small scale perf improvement

This commit is contained in:
Géry Debongnie
2022-06-09 13:29:28 +02:00
committed by Sam Degueldre
parent 0e6059467f
commit d046913a01
3 changed files with 27 additions and 25 deletions
+9 -4
View File
@@ -321,10 +321,15 @@ export class ComponentNode<P extends Props = any, E = any> implements VNode<Comp
}
}
_patch() {
const hasChildren = Object.keys(this.children).length > 0;
this.children = this.fiber!.childrenMap;
this.bdom!.patch(this!.fiber!.bdom!, hasChildren);
this.fiber!.appliedToDom = true;
let hasChildren = false;
for (let _k in this.children) {
hasChildren = true;
break;
}
const fiber = this.fiber!;
this.children = fiber.childrenMap;
this.bdom!.patch(fiber.bdom!, hasChildren);
fiber.appliedToDom = true;
this.fiber = null;
}