https://kotlinlang.org logo
#koin-contributors
Title
# koin-contributors
a

arnaud.giuliani

03/01/2024, 8:19 AM
A proposed of flatten modules function PR : https://github.com/InsertKoinIO/koin/pull/1801
👀 1
👍 1
l

LeoColman

03/02/2024, 7:14 PM
I'd suggest a check/attempt on
tailrec
flatten
is very well defined recursively, and adding extra allocations explicitly clutters the code and makes it less readable than the recursive version
I think maybe fixing the recursive version is possible instead of replacing it by an iterative one
m

Marcello Galhardo

03/04/2024, 11:41 AM
That is very nice, thank you for the heads-up here Arnaudi! I did a review in the CL. 🙂
About using a recursive
tailrec
or a iterative approach, for such a simple self-contianed and “by the book” BFS, my opinion is that these implementation details are irrelevant; I would avoid entering the realm of bike-shedding here. Also, the fact we are basically rolling back to the original
flatten
implementation due to performance issues is a strong statement we don’t need to over complicate. Of course, we can always do improvements and change to another approach if the need appears.
a

arnaud.giuliani

03/04/2024, 6:24 PM
Ok, let's keep the classic flatten by hand then 🙂
tailrec is overkill here