Variable assignment in a conditional makes me uncomfortable; is there a reasonably clean way to do this without it?