VLAZ's user avatar
VLAZ's user avatar
VLAZ's user avatar
VLAZ
  • Member for 5 years, 3 months
  • Last seen this week
Stats
8,765
reputation
110k
reached
37
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
54
bronze badges
445
Score
29
Posts
47
Posts %
185
Score
12
Posts
19
Posts %
60
Score
5
Posts
8
Posts %
46
Score
5
Posts
8
Posts %
30
Score
10
Posts
16
Posts %
21
Score
8
Posts
13
Posts %
Top posts
View all questions and answers