diff --git a/src/nodes/core/NodeBuilder.js b/src/nodes/core/NodeBuilder.js index 9af172c0413fb1..d35b66e0eb14a8 100644 --- a/src/nodes/core/NodeBuilder.js +++ b/src/nodes/core/NodeBuilder.js @@ -135,9 +135,9 @@ class NodeBuilder { * A list of all nodes the builder is processing * for this 3D object. * - * @type {Array} + * @type {Set} */ - this.nodes = []; + this.nodes = new Set(); /** * A list of all nodes the builder is processing in sequential order. @@ -531,7 +531,7 @@ class NodeBuilder { */ includes( node ) { - return this.nodes.includes( node ); + return this.nodes.has( node ); } @@ -816,9 +816,9 @@ class NodeBuilder { */ addNode( node ) { - if ( this.nodes.includes( node ) === false ) { + if ( this.nodes.has( node ) === false ) { - this.nodes.push( node ); + this.nodes.add( node ); this.setHashNode( node, node.getHash( this ) );