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 4 years, 6 months
0 profile views
Last seen Oct 3 at 20:01
- Stack Overflow 8.8k 8.8k 66 gold badges2525 silver badges3838 bronze badges
- Worldbuilding 1.3k 1.3k 11 gold badge77 silver badges2121 bronze badges
- Science Fiction & Fantasy 491 491 66 silver badges1515 bronze badges
- Code Review 403 403 33 silver badges1010 bronze badges
- Information Security 322 322 33 silver badges99 bronze badges
- View network profile →
Top network posts
- 40 Origin of genies (from lamps) having a three wish limit?
- 18 Short story about people being sacrificed during a flight
- 17 What could an "<img src=" XSS do?
- 16 Player class for RPG/DND type game
- 15 How can an eldritch abomination hide its true form in public?
- View more network posts →