Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c7c4b2e

Browse files
authoredAug 24, 2022
Avoid multiple lookups in WebGLRenderLists.get (mrdoob#24535)
1 parent 8a36b63 commit c7c4b2e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎src/renderers/webgl/WebGLRenderLists.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,23 +194,24 @@ function WebGLRenderLists() {
194194

195195
function get( scene, renderCallDepth ) {
196196

197+
const listArray = lists.get( scene );
197198
let list;
198199

199-
if ( lists.has( scene ) === false ) {
200+
if ( listArray === undefined ) {
200201

201202
list = new WebGLRenderList();
202203
lists.set( scene, [ list ] );
203204

204205
} else {
205206

206-
if ( renderCallDepth >= lists.get( scene ).length ) {
207+
if ( renderCallDepth >= listArray.length ) {
207208

208209
list = new WebGLRenderList();
209-
lists.get( scene ).push( list );
210+
listArray.push( list );
210211

211212
} else {
212213

213-
list = lists.get( scene )[ renderCallDepth ];
214+
list = listArray[ renderCallDepth ];
214215

215216
}
216217

0 commit comments

Comments
 (0)
Please sign in to comment.