VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 5 years, 2 months
  • Last seen this week
Stats
8,648
reputation
110k
reached
36
answers
25
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

3
gold badges
20
silver badges
53
bronze badges
445
Score
29
Posts
48
Posts %
185
Score
12
Posts
20
Posts %
60
Score
5
Posts
8
Posts %
46
Score
5
Posts
8
Posts %
21
Score
8
Posts
13
Posts %
19
Score
9
Posts
15
Posts %
Top posts
View all questions and answers