hopefully that gets optimized so that it’s not doing that concat of lists every time
a
Adam Powell
04/06/2021, 12:29 AM
I would be very surprised if it did anything to skip the concatenations. There are all sorts of semantically meaningful differences between those code snippets as written that can't be easily distinguished at compile time
e
ephemient
04/06/2021, 1:11 AM
compiler can do constant addition, and it would even be justified to lift out addition of non-constant basic numeric types (although I don't think kotlinc does that now), but definitely not