stdlib: Don't suppress internal call error for mapCapacity
This patch removes @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
annotation from mapCapacity() calls since it is annotated with
@PublishedApi
This commit is contained in:
@@ -1270,8 +1270,7 @@ public fun Collection<Short>.toShortArray(): ShortArray {
|
||||
* The returned map preserves the entry iteration order of the original collection.
|
||||
*/
|
||||
public inline fun <T, K, V> Iterable<T>.associate(transform: (T) -> Pair<K, V>): Map<K, V> {
|
||||
val capacity = @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
|
||||
mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
|
||||
val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
|
||||
return associateTo(LinkedHashMap<K, V>(capacity), transform)
|
||||
}
|
||||
|
||||
@@ -1284,8 +1283,7 @@ public inline fun <T, K, V> Iterable<T>.associate(transform: (T) -> Pair<K, V>):
|
||||
* The returned map preserves the entry iteration order of the original collection.
|
||||
*/
|
||||
public inline fun <T, K> Iterable<T>.associateBy(keySelector: (T) -> K): Map<K, T> {
|
||||
val capacity = @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
|
||||
mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
|
||||
val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
|
||||
return associateByTo(LinkedHashMap<K, T>(capacity), keySelector)
|
||||
}
|
||||
|
||||
@@ -1297,8 +1295,7 @@ public inline fun <T, K> Iterable<T>.associateBy(keySelector: (T) -> K): Map<K,
|
||||
* The returned map preserves the entry iteration order of the original collection.
|
||||
*/
|
||||
public inline fun <T, K, V> Iterable<T>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V> {
|
||||
val capacity = @Suppress("NON_PUBLIC_CALL_FROM_PUBLIC_INLINE")
|
||||
mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
|
||||
val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)
|
||||
return associateByTo(LinkedHashMap<K, V>(capacity), keySelector, valueTransform)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user