Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGLProgram: Simplify condition. #22767

Merged
merged 1 commit into from
Nov 1, 2021
Merged

WebGLProgram: Simplify condition. #22767

merged 1 commit into from
Nov 1, 2021

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Nov 1, 2021

Related issue: -

Description

Instead of having !! material.sheen > 0 it is sufficient to have material.sheen > 0 because the result of this statement is already a boolean.

@gkjohnson
Copy link
Collaborator

Just something I felt an urge to understand because the current behavior wasn't obvious to me but it seems the !! material.sheen term evaluates first so the current implementation actually tests true > 0 or false > 0. Maybe some good JS order of operations trivia knowledge

@mrdoob
Copy link
Owner

mrdoob commented Nov 1, 2021

All that ! foo and !! foo stuff is evil...

@mrdoob mrdoob added this to the r135 milestone Nov 1, 2021
@mrdoob mrdoob merged commit 88b6328 into mrdoob:dev Nov 1, 2021
@mrdoob
Copy link
Owner

mrdoob commented Nov 1, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants