use internal val instead of fun
This commit is contained in:
@@ -56,17 +56,17 @@ private class ImmutableArrayList<T>(
|
|||||||
// TODO: efficiently implement iterator and other stuff
|
// TODO: efficiently implement iterator and other stuff
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: make val, see http://youtrack.jetbrains.com/issue/KT-2028
|
// TODO: make private val, see http://youtrack.jetbrains.com/issue/KT-2028
|
||||||
private fun emptyArray(): Array<Any?> = arrayOfNulls(0)
|
internal val emptyArray = arrayOfNulls<Any?>(0)
|
||||||
|
|
||||||
public class ImmutableArrayListBuilder<T>() {
|
public class ImmutableArrayListBuilder<T>() {
|
||||||
|
|
||||||
private var array = emptyArray()
|
private var array = emptyArray
|
||||||
private var length = 0
|
private var length = 0
|
||||||
|
|
||||||
public fun build(): List<T> {
|
public fun build(): List<T> {
|
||||||
val r = ImmutableArrayList<T>(array as Array<T>, 0, length)
|
val r = ImmutableArrayList<T>(array as Array<T>, 0, length)
|
||||||
array = emptyArray()
|
array = emptyArray
|
||||||
length = 0
|
length = 0
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user