Browse Source

WebGLProgram: Removed redundant lookup.

tschw 10 years ago
parent
commit
89fdbd0dd3
1 changed files with 10 additions and 8 deletions
  1. 10 8
      src/renderers/webgl/WebGLProgram.js

+ 10 - 8
src/renderers/webgl/WebGLProgram.js

@@ -436,28 +436,30 @@ THREE.WebGLProgram = ( function () {
 
 
 		// set up caching for uniform locations
 		// set up caching for uniform locations
 
 
-		var getUniforms = function() { return this._cachedUniforms; };
+		var _cachedUniforms;
+
+		var getUniforms = function() { return _cachedUniforms; };
 
 
 		this.getUniforms = function() {
 		this.getUniforms = function() {
 
 
 			// fetch, cache, and next time just use a dumb accessor
 			// fetch, cache, and next time just use a dumb accessor
-			var uniforms = fetchUniformLocations( gl, program );
-			this._cachedUniforms = uniforms;
+			_cachedUniforms = fetchUniformLocations( gl, program );
 			this.getUniforms = getUniforms;
 			this.getUniforms = getUniforms;
-			return uniforms;
+			return _cachedUniforms;
 
 
 		};
 		};
 
 
 		// set up caching for attribute locations
 		// set up caching for attribute locations
 
 
-		var getAttributes = function() { return this._cachedAttributes; };
+		var _cachedAttributes;
+
+		var getAttributes = function() { return _cachedAttributes; };
 
 
 		this.getAttributes = function() {
 		this.getAttributes = function() {
 
 
-			var attributes = fetchAttributeLocations( gl, program );
-			this._cachedAttributes = attributes;
+			_cachedAttributes = fetchAttributeLocations( gl, program );
 			this.getAttributes = getAttributes;
 			this.getAttributes = getAttributes;
-			return attributes;
+			return _cachedAttributes;
 
 
 		};
 		};