use kotlin Iterable/Iterator

instead of java Iterable/Iterator
in Kotlin code in library
This commit is contained in:
Svetlana Isakova
2012-08-14 15:24:13 +04:00
parent df93a26839
commit ca6d7e643e
19 changed files with 88 additions and 104 deletions
@@ -4,7 +4,7 @@ import kotlin.test.assertEquals
import org.junit.Test as test
import kotlin.test.failsWith
fun fibonacci(): java.util.Iterator<Int> {
fun fibonacci(): Iterator<Int> {
// fibonacci terms
var index = 0; var a = 0; var b = 1
return iterate<Int> { when (index++) { 0 -> a; 1 -> b; else -> { val result = a + b; a = b; b = result; result } } }