The diff has been significantly modified, but github kept our comments: the code as it exists already has the early return, but rather than an early return, it was made an if up on line 61. I think that's far cleaner than the two nested ifs it was before.