Small improvement on c48b25376f: exit earlier