From 285b51a1c1a029af6cd5294bffe13f857e6076a4 Mon Sep 17 00:00:00 2001 From: Nicholas Kinsey Date: Sat, 24 Sep 2011 15:40:47 +1000 Subject: [PATCH] Optimising THREE.ExtrudeGeometry::addShape --- src/extras/geometries/ExtrudeGeometry.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/extras/geometries/ExtrudeGeometry.js b/src/extras/geometries/ExtrudeGeometry.js index b05a44a0ab70a..927640e0c2397 100644 --- a/src/extras/geometries/ExtrudeGeometry.js +++ b/src/extras/geometries/ExtrudeGeometry.js @@ -198,11 +198,9 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) { var contour = vertices; // vertices has all points but contour has only points of circumference for ( h = 0, hl = holes.length; h < hl; h ++ ) { - - ahole = holes[ h ]; - - vertices = vertices.concat( ahole ); - + + Array.prototype.push.apply( vertices, holes[ h ] ); + } @@ -384,7 +382,7 @@ THREE.ExtrudeGeometry.prototype.addShape = function( shape, options ) { } holesMovements.push( oneHoleMovements ); - verticesMovements = verticesMovements.concat( oneHoleMovements ); + Array.prototype.push.apply( verticesMovements, oneHoleMovements ); }