Deprecate sumBy and sumByDouble with WARNING

This commit is contained in:
Abduqodiri Qurbonzoda
2021-04-08 03:44:52 +03:00
parent 983985bc68
commit 33b44585c4
16 changed files with 203 additions and 4 deletions
@@ -2003,6 +2003,8 @@ public inline fun <R> CharSequence.scanIndexed(initial: R, operation: (index: In
/**
* Returns the sum of all values produced by [selector] function applied to each character in the char sequence.
*/
@Deprecated("Use sumOf instead.", ReplaceWith("this.sumOf(selector)"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public inline fun CharSequence.sumBy(selector: (Char) -> Int): Int {
var sum: Int = 0
for (element in this) {
@@ -2014,6 +2016,8 @@ public inline fun CharSequence.sumBy(selector: (Char) -> Int): Int {
/**
* Returns the sum of all values produced by [selector] function applied to each character in the char sequence.
*/
@Deprecated("Use sumOf instead.", ReplaceWith("this.sumOf(selector)"))
@DeprecatedSinceKotlin(warningSince = "1.5")
public inline fun CharSequence.sumByDouble(selector: (Char) -> Double): Double {
var sum: Double = 0.0
for (element in this) {