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

miha-x64

03/24/2017, 5:00 PM
Copy code
operator fun <T> T.plus(collection: Collection<T>): List<T> {
    val result = ArrayList<T>(collection.size + 1)
    result.add(this)
    result.addAll(collection)
    return result
}
e

enleur

03/24/2017, 5:03 PM
Copy code
operator fun <T> T.plus(collection: Collection<T>) = ArrayList<T>(collection.size + 1).also {
    it.add(this)
    it.addAll(collection)
}
😄
K 1
m

miha-x64

03/24/2017, 5:04 PM
okay_face.jpg
2 Views