This is a hot function, and recursion makes it more difficult to profile, as well as likely making it more difficult to optimize.