Repository: ktorio/ktor
File: ktor-utils/common/src/io/ktor/util/StringValues.kt (Kotlin)

Code before:
public fun StringValuesBuilder.appendAll(vararg values: Pair<String, String>): StringValuesBuilder = apply {
    values.forEach { (key, value) -> append(key, value) }
}

/**
 * Appends multiple key-value pairs where values are [Iterable] to this builder
 *
 * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.util.StringValuesBuilder.appendAll)
 *
 * @param values the key-value pairs to append where values are [Iterable] of strings
 * @return this builder instance
 */
@JvmName("appendAllIterable")
public fun StringValuesBuilder.appendAll(vararg values: Pair<String, Iterable<String>>): StringValuesBuilder = apply {
    values.forEach { (key, value) -> appendAll(key, value) }
}

/**
 * Appends multiple key-value pairs from a [Map] where values are [Iterable] to this builder
 *
 * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.util.StringValuesBuilder.appendAll)
 *
 * @param values the map containing key-value pairs to append where values are [Iterable] of strings
 * @return this builder instance
 */
@JvmName("appendAllIterableWithMap")
public fun StringValuesBuilder.appendAll(values: Map<String, Iterable<String>>): StringValuesBuilder = apply {
    values.forEach { (key, value) -> appendAll(key, value) }
}

/**
 * Appends multiple key-value pairs from a [Map] to this builder
 *
 * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.util.StringValuesBuilder.appendAll)
 *
 * @param values the map containing key-value pairs to append
 * @return this builder instance
 */
@JvmName("appendAllIterableWithMapList")
public fun StringValuesBuilder.appendAll(values: Map<String, String>): StringValuesBuilder = apply {
    values.forEach { (key, value) -> append(key, value) }
}

private fun entriesEquals(a: Set<Map.Entry<String, List<String>>>, b: Set<Map.Entry<String, List<String>>>): Boolean {
    return a == b
}

private fun entriesHashCode(entries: Set<Map.Entry<String, List<String>>>, seed: Int): Int {
    return seed * 31 + entries.hashCode()
}


Review comment (suggestion):
💅  The name can be the same as for vararg function - `appendAllIterable` as argument types are different and signatures won't clash

Code after:
public fun StringValuesBuilder.appendAll(vararg values: Pair<String, String>): StringValuesBuilder = apply {
    values.forEach { (key, value) -> append(key, value) }
}

/**
 * Appends multiple key-value pairs where values are [Iterable] to this builder
 *
 * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.util.StringValuesBuilder.appendAll)
 *
 * @param values the key-value pairs to append where values are [Iterable] of strings
 * @return this builder instance
 */
@JvmName("appendAllIterable")
public fun StringValuesBuilder.appendAll(vararg values: Pair<String, Iterable<String>>): StringValuesBuilder = apply {
    values.forEach { (key, value) -> appendAll(key, value) }
}

/**
 * Appends multiple key-value pairs from a [Map] where values are [Iterable] to this builder
 *
 * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.util.StringValuesBuilder.appendAll)
 *
 * @param values the map containing key-value pairs to append where values are [Iterable] of strings
 * @return this builder instance
 */
@JvmName("appendAllIterable")
public fun StringValuesBuilder.appendAll(values: Map<String, Iterable<String>>): StringValuesBuilder = apply {
    values.forEach { (key, value) -> appendAll(key, value) }
}

/**
 * Appends multiple key-value pairs from a [Map] to this builder
 *
 * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.util.StringValuesBuilder.appendAll)
 *
 * @param values the map containing key-value pairs to append
 * @return this builder instance
 */
public fun StringValuesBuilder.appendAll(values: Map<String, String>): StringValuesBuilder = apply {
    values.forEach { (key, value) -> append(key, value) }
}

private fun entriesEquals(a: Set<Map.Entry<String, List<String>>>, b: Set<Map.Entry<String, List<String>>>): Boolean {
    return a == b
}

private fun entriesHashCode(entries: Set<Map.Entry<String, List<String>>>, seed: Int): Int {
    return seed * 31 + entries.hashCode()
}