To be, or not to be, that is the question
Translating it into code, we get
theQuestion = 2b || !2b
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
Member for 5 years, 3 months
1 profile view
Last seen 12 hours ago
- Stack Overflow 13.7k 13.7k 77 gold badges3232 silver badges4646 bronze badges
- Worldbuilding 4.9k 4.9k 22 gold badges1212 silver badges3636 bronze badges
- Meta Stack Exchange 1.1k 1.1k 77 silver badges1515 bronze badges
- Science Fiction & Fantasy 771 771 77 silver badges1616 bronze badges
- Code Review 445 445 33 silver badges1212 bronze badges
- View network profile
Top network posts
- 71 Why would people bury their dead in tombs when they might become zombies?
- 56 Where could a vampire get blood without harming people?
- 44 Backwards the migration close reason text is
- 40 Origin of genies (from lamps) having a three wish limit?
- 31 What flaw keeps the mimics out and keeps the humans in?
- View more network posts →