EHN: return early when the result is None
There's no need to continue the loop when the result is destined to be None.
I prefer single-return, but not a huge deal > I prefer single-return, but not a huge deal

Switched to using `break` instead. Thanks @zhiqiangxu 