소스 검색

add double linked refs only once

Martin Kunz 1 년 전
부모
커밋
1dfc1b91ea
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      src/ua/UABaseNode.ts

+ 4 - 2
src/ua/UABaseNode.ts

@@ -37,9 +37,11 @@ export class UABaseNode implements IToXML{
                 case ReferencyType.HasProperty:
                 case ReferencyType.HasSubtype:
                     if(ref.isForward) {
-                        this.children.push(node);
+                        if(!this.children.includes(node))
+                            this.children.push(node);
                     } else {
-                        node.children.push(this);
+                        if(!node.children.includes(this))
+                            node.children.push(this);
                     }
                     break;
                 }