VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 8 years, 10 months
  • Last seen this week
Stats
7,819
reputation
170k
reached
77
answers
1
question
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
24
silver badges
56
bronze badges
251
Score
25
Posts
32
Posts %
222
Score
8
Posts
10
Posts %
101
Score
11
Posts
14
Posts %
96
Score
5
Posts
6
Posts %
86
Score
5
Posts
6
Posts %
84
Score
8
Posts
10
Posts %
Top posts
View all questions and answers