Remove manually inlined code in favour of a recursive function call, no
functional change.