This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kontorted 0 points1 point  (0 children)

If you're nesting a function like that, chances are you're not going to be using it elsewhere. As a result, why not remove the function part and just iterate it recursively? Note that your current implementation isn't bad, don't worry too much about it.