For-loop range expression (collection) can not be null

This commit is contained in:
Andrey Breslav
2012-08-24 15:36:55 +04:00
parent b315bee7b2
commit 66faa0c03a
24 changed files with 39 additions and 60 deletions
@@ -5,7 +5,7 @@ fun Int.plus(a: Int?) = this + a.sure()
public open class PerfectNumberFinder() {
open public fun isPerfect(number : Int) : Boolean {
var factors : List<Int?>? = ArrayList<Int?>()
var factors : List<Int?> = ArrayList<Int?>()
factors?.add(1)
factors?.add(number)
for (i in 2..(Math.sqrt((number).toDouble()) - 1).toInt())