Fix ApplyBehaviorsOnSiblings type and performance

This commit is contained in:
Eric NGUYEN 2022-08-31 10:55:34 +02:00
parent 191fa9cfa2
commit 5fdee602f1

View file

@ -42,12 +42,17 @@ export function ApplyBehaviors(container: IContainerModel, symbols: Map<string,
* @param symbols * @param symbols
* @returns * @returns
*/ */
export function ApplyBehaviorsOnSiblings(newContainer: ContainerModel, symbols: Map<string, ISymbolModel>): void { export function ApplyBehaviorsOnSiblings(newContainer: IContainerModel, symbols: Map<string, ISymbolModel>): void {
if (newContainer.parent === null || newContainer.parent === undefined) { if (newContainer.parent === null || newContainer.parent === undefined) {
return; return;
} }
newContainer.parent.children newContainer.parent.children
.filter(container => newContainer !== container) .forEach((container: IContainerModel) => {
.forEach(container => ApplyBehaviors(container, symbols)); if (container === newContainer) {
return;
}
ApplyBehaviors(container, symbols);
});
} }