Explorar o código

Improve Matrix3 closure performance

Tristan VALCKE %!s(int64=8) %!d(string=hai) anos
pai
achega
2b46f6288c
Modificáronse 1 ficheiros con 1 adicións e 3 borrados
  1. 1 3
      src/math/Matrix3.js

+ 1 - 3
src/math/Matrix3.js

@@ -97,12 +97,10 @@ Object.assign( Matrix3.prototype, {
 
 	applyToBufferAttribute: function () {
 
-		var v1;
+		var v1 = new Vector3();
 
 		return function applyToBufferAttribute( attribute ) {
 
-			if ( v1 === undefined ) v1 = new Vector3();
-
 			for ( var i = 0, l = attribute.count; i < l; i ++ ) {
 
 				v1.x = attribute.getX( i );