Browse Source

Merge pull request #6194 from makc/patch-2

Slightly faster BufferGeometry's toJSON
Mr.doob 10 years ago
parent
commit
5f6960dd53
1 changed files with 1 additions and 7 deletions
  1. 1 7
      src/core/BufferGeometry.js

+ 1 - 7
src/core/BufferGeometry.js

@@ -896,13 +896,7 @@ THREE.BufferGeometry.prototype = {
 
 			var attribute = attributes[ key ];
 
-			var array = [], typeArray = attribute.array;
-
-			for ( var i = 0, l = typeArray.length; i < l; i ++ ) {
-
-				array[ i ] = typeArray[ i ];
-
-			}
+			var array = Array.prototype.slice.call( attribute.array );
 
 			output.data.attributes[ key ] = {
 				itemSize: attribute.itemSize,