StdLib cleanup: drop deprecated iterators and streams.

This commit is contained in:
Ilya Gorbunov
2015-06-26 00:09:38 +03:00
parent 6d4e48ab9a
commit 4660b07687
23 changed files with 7 additions and 2320 deletions
-192
View File
@@ -40,23 +40,6 @@ public fun Sequence<Int>.average(): Double {
return if (count == 0) 0.0 else sum / count
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfInt")
public fun Stream<Int>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
var count: Int = 0
while (iterator.hasNext()) {
sum += iterator.next()
count += 1
}
return if (count == 0) 0.0 else sum / count
}
/**
* Returns an average value of elements in the collection.
*/
@@ -116,23 +99,6 @@ public fun Sequence<Long>.average(): Double {
return if (count == 0) 0.0 else sum / count
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfLong")
public fun Stream<Long>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
var count: Int = 0
while (iterator.hasNext()) {
sum += iterator.next()
count += 1
}
return if (count == 0) 0.0 else sum / count
}
/**
* Returns an average value of elements in the collection.
*/
@@ -192,23 +158,6 @@ public fun Sequence<Byte>.average(): Double {
return if (count == 0) 0.0 else sum / count
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfByte")
public fun Stream<Byte>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
var count: Int = 0
while (iterator.hasNext()) {
sum += iterator.next()
count += 1
}
return if (count == 0) 0.0 else sum / count
}
/**
* Returns an average value of elements in the collection.
*/
@@ -268,23 +217,6 @@ public fun Sequence<Short>.average(): Double {
return if (count == 0) 0.0 else sum / count
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfShort")
public fun Stream<Short>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
var count: Int = 0
while (iterator.hasNext()) {
sum += iterator.next()
count += 1
}
return if (count == 0) 0.0 else sum / count
}
/**
* Returns an average value of elements in the collection.
*/
@@ -344,23 +276,6 @@ public fun Sequence<Double>.average(): Double {
return if (count == 0) 0.0 else sum / count
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfDouble")
public fun Stream<Double>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
var count: Int = 0
while (iterator.hasNext()) {
sum += iterator.next()
count += 1
}
return if (count == 0) 0.0 else sum / count
}
/**
* Returns an average value of elements in the collection.
*/
@@ -420,23 +335,6 @@ public fun Sequence<Float>.average(): Double {
return if (count == 0) 0.0 else sum / count
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns an average value of elements in the collection.
*/
platformName("averageOfFloat")
public fun Stream<Float>.average(): Double {
val iterator = iterator()
var sum: Double = 0.0
var count: Int = 0
while (iterator.hasNext()) {
sum += iterator.next()
count += 1
}
return if (count == 0) 0.0 else sum / count
}
/**
* Returns an average value of elements in the collection.
*/
@@ -492,21 +390,6 @@ public fun Sequence<Int>.sum(): Int {
return sum
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfInt")
public fun Stream<Int>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
while (iterator.hasNext()) {
sum += iterator.next()
}
return sum
}
/**
* Returns the sum of all elements in the collection.
*/
@@ -558,21 +441,6 @@ public fun Sequence<Long>.sum(): Long {
return sum
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfLong")
public fun Stream<Long>.sum(): Long {
val iterator = iterator()
var sum: Long = 0
while (iterator.hasNext()) {
sum += iterator.next()
}
return sum
}
/**
* Returns the sum of all elements in the collection.
*/
@@ -624,21 +492,6 @@ public fun Sequence<Byte>.sum(): Int {
return sum
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfByte")
public fun Stream<Byte>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
while (iterator.hasNext()) {
sum += iterator.next()
}
return sum
}
/**
* Returns the sum of all elements in the collection.
*/
@@ -690,21 +543,6 @@ public fun Sequence<Short>.sum(): Int {
return sum
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfShort")
public fun Stream<Short>.sum(): Int {
val iterator = iterator()
var sum: Int = 0
while (iterator.hasNext()) {
sum += iterator.next()
}
return sum
}
/**
* Returns the sum of all elements in the collection.
*/
@@ -756,21 +594,6 @@ public fun Sequence<Double>.sum(): Double {
return sum
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfDouble")
public fun Stream<Double>.sum(): Double {
val iterator = iterator()
var sum: Double = 0.0
while (iterator.hasNext()) {
sum += iterator.next()
}
return sum
}
/**
* Returns the sum of all elements in the collection.
*/
@@ -822,21 +645,6 @@ public fun Sequence<Float>.sum(): Float {
return sum
}
deprecated("Migrate to using Sequence<T> and respective functions")
/**
* Returns the sum of all elements in the collection.
*/
platformName("sumOfFloat")
public fun Stream<Float>.sum(): Float {
val iterator = iterator()
var sum: Float = 0.0f
while (iterator.hasNext()) {
sum += iterator.next()
}
return sum
}
/**
* Returns the sum of all elements in the collection.
*/