Closed GoogleCodeExporter closed 9 years ago
I would advise to keep the unreachable default case in place.
It may still be hit due to memory corruption, in which case it would be
incredibly useful to be notified of it (especially when it's reproducible).
Also, it only takes a minor code change to actually require this default case.
As far as I'm aware this also isn't performance critical code. But even so,
optimized builds may still remove the unreachable code, but for debugging
builds it is in my experience valuable to keep such code around.
Frankly, optimizing code is the task of optimizers and profilers, not code
coverage tools. Unless this pops up as a hotspot, I would indeed suggest
defensive programming.
Original comment by Nicolas....@gmail.com
on 12 Oct 2010 at 10:37
I agree with Nicolas here. Keeping the default case is completely harmless in
this case.
Original comment by alokp@chromium.org
on 14 Oct 2010 at 6:51
Original issue reported on code.google.com by
timel...@gmail.com
on 12 Oct 2010 at 4:20Attachments: