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, 3 months
13 profile views
Last seen Jul 12 at 15:39
- Stack Overflow 7.4k 7.4k 55 gold badges2525 silver badges3838 bronze badges
- Worldbuilding 904 904 11 gold badge77 silver badges2020 bronze badges
- Science Fiction & Fantasy 461 461 66 silver badges1414 bronze badges
- Code Review 403 403 33 silver badges1010 bronze badges
- Information Security 313 313 33 silver badges88 bronze badges
- View network profile →
Top network posts
- 40 Origin of genies (from lamps) having a three wish limit?
- 16 Short story about people being sacrificed during a flight
- 16 Player class for RPG/DND type game
- 16 What could an "<img src=" XSS do?
- 15 How can an eldritch abomination hide its true form in public?
- View more network posts →