Skip to content

Commit

Permalink
WebGLRenderer: remove redundant code (#28186)
Browse files Browse the repository at this point in the history
The null check seems to have been redundant.

This code should behave the same as the previous code and return `null` when
`context === null` or return `context` otherwise.

Maybe there is a good reason it was like it was (ability to put a debugger on
line 227?) in which case feel free to decline this PR - I just came across the
code when I was searching for something else and thought I'd clean it up in
case it was unnecessarily there based on a historical change...
  • Loading branch information
vitch committed Apr 22, 2024
1 parent 31b2f94 commit 4d6fa0d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,7 @@ class WebGLRenderer {

function getContext( contextName, contextAttributes ) {

const context = canvas.getContext( contextName, contextAttributes );
if ( context !== null ) return context;

return null;
return canvas.getContext( contextName, contextAttributes );

}

Expand Down

0 comments on commit 4d6fa0d

Please sign in to comment.