https://kotlinlang.org logo
#announcements
Title
# announcements
k

Kulwinder Singh

07/08/2019, 3:20 AM
is there a any better way of doing this ? here i just want another list without first element
r

runjorel

07/08/2019, 3:33 AM
list.tail()
k

Kulwinder Singh

07/08/2019, 3:34 AM
there is no function called
tail()
r

runjorel

07/08/2019, 3:37 AM
indeed .. I use that from another lib. I think
list.drop(1)
works too
👍 1
k

Kulwinder Singh

07/08/2019, 3:41 AM
drop()
is that what i was looking for, thanks a lot
what is more better solution performance wise
drop
or
what i was doing earlier
?
r

runjorel

07/08/2019, 4:28 AM
Most likely, the drop version is more performant.
Honestly though, in most situations you probably won't notice much perf difference between the two. It's most likely just Java arraylists underneath at runtime anyway. By what you're doing earlier you're merely adding another layer of indirection that could probably be JIT'ed away. Then again I could totally be off on this so maybe someone more informed can correct me.
👍 1
2 Views