From 80d69bf334782699942cbab8fd370e5eeb517d41 Mon Sep 17 00:00:00 2001 From: dubejf Date: Fri, 5 Sep 2014 15:53:55 -0400 Subject: [PATCH] reorderBuffers: call ctor of typed array directly Update to mrdoob/three.js#5262 --- src/core/BufferGeometry.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/core/BufferGeometry.js b/src/core/BufferGeometry.js index 0fd55100ff..fdda758d6a 100644 --- a/src/core/BufferGeometry.js +++ b/src/core/BufferGeometry.js @@ -834,13 +834,7 @@ THREE.BufferGeometry.prototype = { if ( attr == 'index' ) continue; var sourceArray = this.attributes[ attr ].array; - for ( var i = 0, il = types.length; i < il; i ++ ) { - var type = types[ i ]; - if ( sourceArray instanceof type ) { - sortedAttributes[ attr ] = new type( this.attributes[ attr ].itemSize * vertexCount ); - break; - } - } + sortedAttributes[ attr ] = new sourceArray.constructor( this.attributes[ attr ].itemSize * vertexCount ); } /* Move attribute positions based on the new index map */ -- GitLab