VLAZ
  • Member for 3 years, 6 months
  • Last seen this week
Stats
3,827
reputation
25k
reached
8
answers
12
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
11
silver badges
28
bronze badges
145
Score
8
Posts
40
Posts %
72
Score
4
Posts
20
Posts %
56
Score
2
Posts
10
Posts %
17
Score
2
Posts
10
Posts %
16
Score
2
Posts
10
Posts %
3
Score
4
Posts
20
Posts %
Top posts
View all questions and answers