ソースを参照

Node.getChildren: Clean up (#26313)

Levi Pesin 2 年 前
コミット
a2adc8b191
1 ファイル変更4 行追加15 行削除
  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;
-
-				} };
-
-			}
+			} };
 
 		}