소스 검색

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 1 년 전
부모
커밋
4d6fa0d96f
1개의 변경된 파일1개의 추가작업 그리고 4개의 파일을 삭제
  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 );
 
 		}