Transform *Array.size to properties
This commit is contained in:
@@ -28,7 +28,7 @@ class GenerateArrayIterators(out: PrintWriter) : BuiltInsSourceGenerator(out) {
|
||||
val s = kind.capitalized
|
||||
out.println("private class Array${s}Iterator(private val array: ${s}Array) : ${s}Iterator() {")
|
||||
out.println(" private var index = 0")
|
||||
out.println(" override fun hasNext() = index < array.size()")
|
||||
out.println(" override fun hasNext() = index < array.size")
|
||||
out.println(" override fun next$s() = array[index++]")
|
||||
out.println("}")
|
||||
out.println()
|
||||
|
||||
@@ -39,7 +39,7 @@ class GenerateArrays(out: PrintWriter) : BuiltInsSourceGenerator(out) {
|
||||
out.println(" public operator fun set(index: Int, value: $s): Unit")
|
||||
out.println()
|
||||
out.println(" /** Returns the number of elements in the array. */")
|
||||
out.println(" public fun size(): Int")
|
||||
out.println(" public val size: Int")
|
||||
out.println()
|
||||
out.println(" /** Creates an iterator over the elements of the array. */")
|
||||
out.println(" public operator fun iterator(): ${s}Iterator")
|
||||
|
||||
Reference in New Issue
Block a user