Join Slack
Powered by
If I have a recursive function where the inner fun...
# coroutines
r
reactormonk
05/24/2023, 1:26 PM
If I have a recursive function where the inner function is called inside a
scope.launch
, presumably that prevents stack overflows on its own, no
tailrec
required?
c
CLOVIS
05/24/2023, 1:27 PM
Yes. You can also use DeepRecursiveFunction:
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-deep-recursive-function/
CLOVIS
05/24/2023, 1:27 PM
However,
tailrec
is
much
more performant if it's available in your case.
Open in Slack
Previous
Next