Optimize the previous check.