isn't `ret < 0` handled by any case in the switches? if so, then if condition is not needed.