Edgars
12/06/2019, 4:38 PMkarelpeeters
12/06/2019, 4:42 PMpathToCom
function just hurts to think about!Edgars
12/06/2019, 4:47 PMkarelpeeters
12/06/2019, 4:49 PMEdgars
12/06/2019, 4:53 PMprivate tailrec fun MutableList<String>.pathToCom(from: String) {
val next = input[from] ?: return
add(next)
pathToCom(next)
}
Runs in almost half the time... from ~0.9ms to ~0.45ms.nils
12/06/2019, 4:53 PM