is there a any better way of doing this ? here i j...
# announcements
k
is there a any better way of doing this ? here i just want another list without first element
r
list.tail()
k
there is no function called
tail()
r
indeed .. I use that from another lib. I think
list.drop(1)
works too
👍 1
k
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
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