Explorar o código

WebGLRenderer: remove redundant code (#28186)

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...
Kelvin Luck hai 1 ano
pai
achega
4d6fa0d96f
Modificáronse 1 ficheiros con 1 adicións e 4 borrados
  1. 1 4
      src/renderers/WebGLRenderer.js

+ 1 - 4
src/renderers/WebGLRenderer.js

@@ -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 );
 
 		}