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

jlleitschuh

03/06/2017, 10:56 PM
does
toMutableList
on a mutable list copy that list? Otherwise, how do you copy a list? I could use the
ArrayList
constructor but if there is a kotlin way of copying a list I'd rather do that.
toMutableList
actually calls
ArrayList(this)
j

jlleitschuh

03/06/2017, 10:59 PM
Good to know. I wasn't sure if there was some check on
this
to see if it was already a mutable list before copying it.
3 Views