Explorar o código

WebGLProperties: No redundant lookup in .get.

tschw %!s(int64=10) %!d(string=hai) anos
pai
achega
6a0c0708c3
Modificáronse 1 ficheiros con 7 adicións e 3 borrados
  1. 7 3
      src/renderers/webgl/WebGLProperties.js

+ 7 - 3
src/renderers/webgl/WebGLProperties.js

@@ -8,13 +8,17 @@ THREE.WebGLProperties = function () {
 
 	this.get = function ( object ) {
 
-		if ( properties[ object.uuid ] === undefined ) {
+		var uuid = object.uuid;
+		var map = properties[ uuid ];
 
-			properties[ object.uuid ] = {};
+		if ( map === undefined ) {
+
+			map = {};
+			properties[ uuid ] = map;
 
 		}
 
-		return properties[ object.uuid ];
+		return map;
 
 	};