Reputation: 145
Which of the following is fastest and what is the justification for why?
(1) if (x == 0 and y == 0)
(2) if ((x | y) == 0)
(3) Other (Please mention. If any)
Upvotes: 0
Views: 68
Reputation: 3450
I would probably use Strict Equality if you want to check they are exactly the same, ie they're the same type too, just in case.
if (x=== 0 && y === 0)
Upvotes: 2