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, 5 months
0 profile views
Last seen Jul 1 at 6:45
- Stack Overflow 8.1k 8.1k 55 gold badges2525 silver badges3838 bronze badges
- Worldbuilding 1.1k 1.1k 11 gold badge77 silver badges2020 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 →