Remove deprecated pairwise function
It was replaced with zipWithNext.
This commit is contained in:
@@ -1867,18 +1867,6 @@ public inline fun <T> Iterable<T>.minusElement(element: T): List<T> {
|
||||
return minus(element)
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext()"))
|
||||
@SinceKotlin("1.2")
|
||||
public fun <T> Iterable<T>.pairwise(): List<Pair<T, T>> {
|
||||
return zipWithNext { a, b -> a to b }
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext(transform)"))
|
||||
@SinceKotlin("1.2")
|
||||
public inline fun <T, R> Iterable<T>.pairwise(transform: (a: T, b: T) -> R): List<R> {
|
||||
return zipWithNext(transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits the original collection into pair of lists,
|
||||
* where *first* list contains elements for which [predicate] yielded `true`,
|
||||
|
||||
@@ -1428,18 +1428,6 @@ public inline fun <T> Sequence<T>.minusElement(element: T): Sequence<T> {
|
||||
return minus(element)
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext()"))
|
||||
@SinceKotlin("1.2")
|
||||
public fun <T> Sequence<T>.pairwise(): Sequence<Pair<T, T>> {
|
||||
return zipWithNext { a, b -> a to b }
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext(transform)"))
|
||||
@SinceKotlin("1.2")
|
||||
public fun <T, R> Sequence<T>.pairwise(transform: (a: T, b: T) -> R): Sequence<R> {
|
||||
return zipWithNext(transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits the original sequence into pair of lists,
|
||||
* where *first* list contains elements for which [predicate] yielded `true`,
|
||||
|
||||
@@ -1168,18 +1168,6 @@ public fun <R> CharSequence.chunkedSequence(size: Int, transform: (CharSequence)
|
||||
return windowedSequence(size, size, partialWindows = true, transform = transform)
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext()"))
|
||||
@SinceKotlin("1.2")
|
||||
public fun CharSequence.pairwise(): List<Pair<Char, Char>> {
|
||||
return zipWithNext { a, b -> a to b }
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext(transform)"))
|
||||
@SinceKotlin("1.2")
|
||||
public inline fun <R> CharSequence.pairwise(transform: (a: Char, b: Char) -> R): List<R> {
|
||||
return zipWithNext(transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits the original char sequence into pair of char sequences,
|
||||
* where *first* char sequence contains characters for which [predicate] yielded `true`,
|
||||
|
||||
@@ -953,14 +953,6 @@ public expect operator fun <T> Iterable<T>.minus(elements: Sequence<T>): List<T>
|
||||
@kotlin.internal.InlineOnly
|
||||
public expect inline fun <T> Iterable<T>.minusElement(element: T): List<T>
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext()"))
|
||||
@SinceKotlin("1.2")
|
||||
public expect fun <T> Iterable<T>.pairwise(): List<Pair<T, T>>
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext(transform)"))
|
||||
@SinceKotlin("1.2")
|
||||
public expect inline fun <T, R> Iterable<T>.pairwise(transform: (a: T, b: T) -> R): List<R>
|
||||
|
||||
/**
|
||||
* Splits the original collection into pair of lists,
|
||||
* where *first* list contains elements for which [predicate] yielded `true`,
|
||||
|
||||
@@ -881,14 +881,6 @@ public expect operator fun <T> Sequence<T>.minus(elements: Sequence<T>): Sequenc
|
||||
@kotlin.internal.InlineOnly
|
||||
public expect inline fun <T> Sequence<T>.minusElement(element: T): Sequence<T>
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext()"))
|
||||
@SinceKotlin("1.2")
|
||||
public expect fun <T> Sequence<T>.pairwise(): Sequence<Pair<T, T>>
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext(transform)"))
|
||||
@SinceKotlin("1.2")
|
||||
public expect fun <T, R> Sequence<T>.pairwise(transform: (a: T, b: T) -> R): Sequence<R>
|
||||
|
||||
/**
|
||||
* Splits the original sequence into pair of lists,
|
||||
* where *first* list contains elements for which [predicate] yielded `true`,
|
||||
|
||||
@@ -696,14 +696,6 @@ public expect fun CharSequence.chunkedSequence(size: Int): Sequence<String>
|
||||
@SinceKotlin("1.2")
|
||||
public expect fun <R> CharSequence.chunkedSequence(size: Int, transform: (CharSequence) -> R): Sequence<R>
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext()"))
|
||||
@SinceKotlin("1.2")
|
||||
public expect fun CharSequence.pairwise(): List<Pair<Char, Char>>
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext(transform)"))
|
||||
@SinceKotlin("1.2")
|
||||
public expect inline fun <R> CharSequence.pairwise(transform: (a: Char, b: Char) -> R): List<R>
|
||||
|
||||
/**
|
||||
* Splits the original char sequence into pair of char sequences,
|
||||
* where *first* char sequence contains characters for which [predicate] yielded `true`,
|
||||
|
||||
@@ -1877,18 +1877,6 @@ public inline fun <T> Iterable<T>.minusElement(element: T): List<T> {
|
||||
return minus(element)
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext()"))
|
||||
@SinceKotlin("1.2")
|
||||
public fun <T> Iterable<T>.pairwise(): List<Pair<T, T>> {
|
||||
return zipWithNext { a, b -> a to b }
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext(transform)"))
|
||||
@SinceKotlin("1.2")
|
||||
public inline fun <T, R> Iterable<T>.pairwise(transform: (a: T, b: T) -> R): List<R> {
|
||||
return zipWithNext(transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits the original collection into pair of lists,
|
||||
* where *first* list contains elements for which [predicate] yielded `true`,
|
||||
|
||||
@@ -1450,18 +1450,6 @@ public inline fun <T> Sequence<T>.minusElement(element: T): Sequence<T> {
|
||||
return minus(element)
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext()"))
|
||||
@SinceKotlin("1.2")
|
||||
public fun <T> Sequence<T>.pairwise(): Sequence<Pair<T, T>> {
|
||||
return zipWithNext { a, b -> a to b }
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext(transform)"))
|
||||
@SinceKotlin("1.2")
|
||||
public fun <T, R> Sequence<T>.pairwise(transform: (a: T, b: T) -> R): Sequence<R> {
|
||||
return zipWithNext(transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits the original sequence into pair of lists,
|
||||
* where *first* list contains elements for which [predicate] yielded `true`,
|
||||
|
||||
@@ -1176,18 +1176,6 @@ public fun <R> CharSequence.chunkedSequence(size: Int, transform: (CharSequence)
|
||||
return windowedSequence(size, size, partialWindows = true, transform = transform)
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext()"))
|
||||
@SinceKotlin("1.2")
|
||||
public fun CharSequence.pairwise(): List<Pair<Char, Char>> {
|
||||
return zipWithNext { a, b -> a to b }
|
||||
}
|
||||
|
||||
@Deprecated("Use zipWithNext instead", ReplaceWith("zipWithNext(transform)"))
|
||||
@SinceKotlin("1.2")
|
||||
public inline fun <R> CharSequence.pairwise(transform: (a: Char, b: Char) -> R): List<R> {
|
||||
return zipWithNext(transform)
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits the original char sequence into pair of char sequences,
|
||||
* where *first* char sequence contains characters for which [predicate] yielded `true`,
|
||||
|
||||
-6
@@ -1668,8 +1668,6 @@ public final class kotlin/collections/CollectionsKt {
|
||||
public static final fun none (Ljava/lang/Iterable;)Z
|
||||
public static final fun none (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Z
|
||||
public static final fun onEach (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Ljava/lang/Iterable;
|
||||
public static final fun pairwise (Ljava/lang/Iterable;)Ljava/util/List;
|
||||
public static final fun pairwise (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function2;)Ljava/util/List;
|
||||
public static final fun partition (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Lkotlin/Pair;
|
||||
public static final fun plus (Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;
|
||||
public static final fun plus (Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/util/List;
|
||||
@@ -3590,8 +3588,6 @@ public final class kotlin/sequences/SequencesKt {
|
||||
public static final fun none (Lkotlin/sequences/Sequence;)Z
|
||||
public static final fun none (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Z
|
||||
public static final fun onEach (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
|
||||
public static final fun pairwise (Lkotlin/sequences/Sequence;)Lkotlin/sequences/Sequence;
|
||||
public static final fun pairwise (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function2;)Lkotlin/sequences/Sequence;
|
||||
public static final fun partition (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/Pair;
|
||||
public static final fun plus (Lkotlin/sequences/Sequence;Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
|
||||
public static final fun plus (Lkotlin/sequences/Sequence;Ljava/lang/Object;)Lkotlin/sequences/Sequence;
|
||||
@@ -3961,8 +3957,6 @@ public final class kotlin/text/StringsKt {
|
||||
public static final fun padStart (Ljava/lang/String;IC)Ljava/lang/String;
|
||||
public static synthetic fun padStart$default (Ljava/lang/CharSequence;ICILjava/lang/Object;)Ljava/lang/CharSequence;
|
||||
public static synthetic fun padStart$default (Ljava/lang/String;ICILjava/lang/Object;)Ljava/lang/String;
|
||||
public static final fun pairwise (Ljava/lang/CharSequence;)Ljava/util/List;
|
||||
public static final fun pairwise (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function2;)Ljava/util/List;
|
||||
public static final fun partition (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)Lkotlin/Pair;
|
||||
public static final fun partition (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lkotlin/Pair;
|
||||
public static final fun prependIndent (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
||||
|
||||
@@ -1527,8 +1527,6 @@ public final class kotlin/collections/CollectionsKt {
|
||||
public static final fun none (Ljava/lang/Iterable;)Z
|
||||
public static final fun none (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Z
|
||||
public static final fun onEach (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Ljava/lang/Iterable;
|
||||
public static final fun pairwise (Ljava/lang/Iterable;)Ljava/util/List;
|
||||
public static final fun pairwise (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function2;)Ljava/util/List;
|
||||
public static final fun partition (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Lkotlin/Pair;
|
||||
public static final fun plus (Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;
|
||||
public static final fun plus (Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/util/List;
|
||||
@@ -2285,8 +2283,6 @@ public final class kotlin/sequences/SequencesKt {
|
||||
public static final fun none (Lkotlin/sequences/Sequence;)Z
|
||||
public static final fun none (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Z
|
||||
public static final fun onEach (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
|
||||
public static final fun pairwise (Lkotlin/sequences/Sequence;)Lkotlin/sequences/Sequence;
|
||||
public static final fun pairwise (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function2;)Lkotlin/sequences/Sequence;
|
||||
public static final fun partition (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/Pair;
|
||||
public static final fun plus (Lkotlin/sequences/Sequence;Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
|
||||
public static final fun plus (Lkotlin/sequences/Sequence;Ljava/lang/Object;)Lkotlin/sequences/Sequence;
|
||||
@@ -2656,8 +2652,6 @@ public final class kotlin/text/StringsKt {
|
||||
public static final fun padStart (Ljava/lang/String;IC)Ljava/lang/String;
|
||||
public static synthetic fun padStart$default (Ljava/lang/CharSequence;ICILjava/lang/Object;)Ljava/lang/CharSequence;
|
||||
public static synthetic fun padStart$default (Ljava/lang/String;ICILjava/lang/Object;)Ljava/lang/String;
|
||||
public static final fun pairwise (Ljava/lang/CharSequence;)Ljava/util/List;
|
||||
public static final fun pairwise (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function2;)Ljava/util/List;
|
||||
public static final fun partition (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)Lkotlin/Pair;
|
||||
public static final fun partition (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lkotlin/Pair;
|
||||
public static final fun prependIndent (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
||||
|
||||
@@ -850,22 +850,6 @@ fun generators(): List<GenericFunction> {
|
||||
body(CharSequences) { "return chunkedSequence(size) { it.toString() }" }
|
||||
}
|
||||
|
||||
templates add f("pairwise(transform: (a: T, b: T) -> R)") {
|
||||
deprecate(Deprecation("Use zipWithNext instead", "zipWithNext(transform)"))
|
||||
since("1.2")
|
||||
only(Iterables, Sequences, CharSequences)
|
||||
typeParam("R")
|
||||
returns("List<R>")
|
||||
inline(true)
|
||||
body {
|
||||
"""
|
||||
return zipWithNext(transform)
|
||||
"""
|
||||
}
|
||||
inline(false, Sequences)
|
||||
returns(Sequences) { "Sequence<R>" }
|
||||
}
|
||||
|
||||
templates add f("zipWithNext(transform: (a: T, b: T) -> R)") {
|
||||
since("1.2")
|
||||
only(Iterables, Sequences, CharSequences)
|
||||
@@ -927,17 +911,6 @@ fun generators(): List<GenericFunction> {
|
||||
}
|
||||
}
|
||||
|
||||
templates add f("pairwise()") {
|
||||
deprecate(Deprecation("Use zipWithNext instead", "zipWithNext()"))
|
||||
since("1.2")
|
||||
only(Iterables, Sequences, CharSequences)
|
||||
returns("List<Pair<T, T>>")
|
||||
returns(Sequences) { "Sequence<Pair<T, T>>" }
|
||||
body {
|
||||
"return zipWithNext { a, b -> a to b }"
|
||||
}
|
||||
}
|
||||
|
||||
templates add f("zipWithNext()") {
|
||||
since("1.2")
|
||||
only(Iterables, Sequences, CharSequences)
|
||||
|
||||
Reference in New Issue
Block a user