VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 8 years, 5 months
  • Last seen this week
Stats
1,380
reputation
2k
reached
7
answers
3
questions
Loading…
About

To be, or not to be, that is the question

Translating it into code, we get

theQuestion = 2b || !2b

This returns true for any value of 2b, making the evaluation redundant. We can optimise it by removing the expression and substituting with the result.

theQuestion = true

1
gold badge
8
silver badges
12
bronze badges
44
Score
8
Posts
80
Posts %
14
Score
1
Posts
10
Posts %
12
Score
1
Posts
10
Posts %
12
Score
1
Posts
10
Posts %
12
Score
1
Posts
10
Posts %
10
Score
2
Posts
20
Posts %