use internal val instead of fun

This commit is contained in:
Stepan Koltsov
2012-05-18 15:04:01 +04:00
parent e2a875286b
commit cdaf8523ed
@@ -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
} }