Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> i is a usize and if i == 0 then i-1 will panic due to underflow.

Not in release mode.



While 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: