2 ms·
> i is a usize and if i == 0 then i-1 will panic due to underflow. Not in release mode.
by masklinn 8y ago
> i is a usize and if i == 0 then i-1 will panic due to underflow.
Not in release mode.
- eridius 8y agoWhile it's true that it doesn't panic in release mode, that's supposed to be an optimization and the correct semantics are what's implemented in debug mode. Besides, you don't want to write a program that only functions in release mode.