I don't really think that's better though.
# announcements
k
I don't really think that's better though.
g
Roughly looks like more efficient, because less allocations, only one list object instead of IntRange + List
j
And 300 invocations of a lamba. A range might have a more efficient way to convert itself to a list. Haven't checked though
k
That's inline, right? No lambda actually exists at runtime.
g
@jstuyts-squins This lambda is inlined, in bytecode and on runtime you will have ArrayList and int loop
j
Great, but
List(300) { it }
does not work. I have look for other variants, but did not find any, except for
Array(300) { it }
k
What do you mean "doesn't work"? It works for me, what version of Kotlin are you on?
g
@jstuyts-squins Works perfectly - https://try.kotlinlang.org/#/UserProjects/ja3te7p41bavd5jk1l2q24sk56/9fcvq4126gbh5ttm2vjdksl99s maybe you use Kotlin 1.0.* instead of 1.1
j
Sorry for the confusion. It seems try.kotlinlang.org decided to lower the language version