`ret` can be `-1`, `0`, `1`, and `2`. A comment explaining what it means for `ret` to be `0` would be useful.