Browse Source

Node.getChildren: Clean up (#26313)

Levi Pesin 2 năm trước cách đây
mục cha
commit
a2adc8b191
1 tập tin đã thay đổi với 4 bổ sung15 xóa
  1. 4 15
      examples/jsm/nodes/core/Node.js

+ 4 - 15
examples/jsm/nodes/core/Node.js

@@ -41,23 +41,12 @@ class Node {
 
 		for ( const { property, index, childNode } of getNodeChildren( this ) ) {
 
-			if ( index !== undefined ) {
-
-				yield { childNode, replaceNode( node ) {
-
-					self[ property ][ index ] = node;
+			yield { childNode, replaceNode( node ) {
 
-				} };
-
-			} else {
+				if ( index === undefined ) self[ property ] = node;
+				else self[ property ][ index ] = node;
 
-				yield { childNode, replaceNode( node ) {
-
-					self[ property ] = node;
-
-				} };
-
-			}
+			} };
 
 		}