VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 8 years, 8 months
  • Last seen this week
Stats
2,308
reputation
72k
reached
15
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

2
gold badges
18
silver badges
30
bronze badges
39
Score
5
Posts
28
Posts %
32
Score
4
Posts
22
Posts %
27
Score
8
Posts
44
Posts %
26
Score
2
Posts
11
Posts %
22
Score
4
Posts
22
Posts %
16
Score
3
Posts
17
Posts %
Top posts
View all questions and answers