tests changed

val hasNext -> fun hasNext()
This commit is contained in:
Svetlana Isakova
2012-08-14 14:47:04 +04:00
parent f96fe4879a
commit e1281953e7
20 changed files with 42 additions and 48 deletions
@@ -155,12 +155,12 @@ public inline fun DoubleArray.foldRight(initial: Double, operation: (Double, Dou
*/
public inline fun DoubleArray.reduce(operation: (Double, Double) -> Double): Double {
val iterator = this.iterator().sure()
if (!iterator.hasNext) {
if (!iterator.hasNext()) {
throw UnsupportedOperationException("Empty iterable can't be reduced")
}
var result: Double = iterator.next() //compiler doesn't understand that result will initialized anyway
while (iterator.hasNext) {
while (iterator.hasNext()) {
result = operation(result, iterator.next())
}