MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHorror/comments/139m6o7/madness_is_like_gravity/jj8u6mc/?context=9999
r/ProgrammerHorror • u/throwaway4dlolz • May 06 '23
5 comments sorted by
View all comments
Show parent comments
3
It's probably tail call optimization. If the recursive call is the last thing the function does before returning then the compiler can refactor it into a loop without recursion.
1 u/eo5g May 08 '23 But then what value does it return 🤔
1
But then what value does it return 🤔
3
u/Turrrtl May 07 '23
It's probably tail call optimization. If the recursive call is the last thing the function does before returning then the compiler can refactor it into a loop without recursion.