Browse Source

Avoid multiple lookups in WebGLRenderLists.get (#24535)

Degubi 2 years ago
parent
commit
c7c4b2e1b6
1 changed files with 5 additions and 4 deletions
  1. 5 4
      src/renderers/webgl/WebGLRenderLists.js

+ 5 - 4
src/renderers/webgl/WebGLRenderLists.js

@@ -194,23 +194,24 @@ function WebGLRenderLists() {
 
 	function get( scene, renderCallDepth ) {
 
+		const listArray = lists.get( scene );
 		let list;
 
-		if ( lists.has( scene ) === false ) {
+		if ( listArray === undefined ) {
 
 			list = new WebGLRenderList();
 			lists.set( scene, [ list ] );
 
 		} else {
 
-			if ( renderCallDepth >= lists.get( scene ).length ) {
+			if ( renderCallDepth >= listArray.length ) {
 
 				list = new WebGLRenderList();
-				lists.get( scene ).push( list );
+				listArray.push( list );
 
 			} else {
 
-				list = lists.get( scene )[ renderCallDepth ];
+				list = listArray[ renderCallDepth ];
 
 			}