I'd use parens to clarify the logic here (at least around the comparison of the select return with -1)