Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ class BridgeInterceptor(private val cookieJar: CookieJar) : Interceptor {
}

/** Returns a 'Cookie' HTTP request header with all cookies, like `a=b; c=d`. */
private fun cookieHeader(cookies: List<Cookie>): String =
buildString {
cookies.forEachIndexed { index, cookie ->
if (index > 0) append("; ")
append(cookie.name).append('=').append(cookie.value)
}
}
private fun cookieHeader(cookies: List<Cookie>): String {
return cookies.joinToString("; ") { "${it.name}=${it.value}" }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this creates a nested StringBuilder for each name/value pair before adding it to an enclosing one, whereas the old code only uses a single one for all pairs.

}
}