HomePhabricator
Diffusion Comm eef5b67932f4

[web] Use nullish coalescing operator in `InputStateContainer`

Description

[web] Use nullish coalescing operator in InputStateContainer

Summary: Quick change I noticed while reading this for video work (I opened the wrong InputStateContainer). Simply removes the ternary and replaces it with a nullish coalescing operator.

Test Plan:
Since dimensions is an object, the only cases it will fail the ternary check is if it's null or undefined (since the object has to be falsy to fail the ternary check).

According to the MDN docs:

The nullish coalescing operator (??) is a logical operator that returns its right-hand side operand when its left-hand side operand is null or undefined.

So this covers the same cases as the ternary, and is more concise.

Reviewers: atul

Reviewed By: atul

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D4873

Details

Provenance
aboshAuthored on Aug 18 2022, 9:52 AM
Reviewer
atul
Differential Revision
D4873: [web] Use nullish coalescing operator in `InputStateContainer`
Parents
rCOMM630cd9b1ac4a: [native] add corrosion to android cmake project
Branches
Unknown
Tags
Unknown