Skip to content

Commit ba16e0d

Browse files
authored
refactor clear (mrdoob#26625)
1 parent 3bb6de2 commit ba16e0d

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/core/Object3D.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -392,20 +392,7 @@ class Object3D extends EventDispatcher {
392392

393393
clear() {
394394

395-
for ( let i = 0; i < this.children.length; i ++ ) {
396-
397-
const object = this.children[ i ];
398-
399-
object.parent = null;
400-
401-
object.dispatchEvent( _removedEvent );
402-
403-
}
404-
405-
this.children.length = 0;
406-
407-
return this;
408-
395+
return this.remove( ... this.children );
409396

410397
}
411398

0 commit comments

Comments
 (0)