Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Rafal Augustyniak <[email protected]>
  • Loading branch information
Augustyniak committed Jun 23, 2022
1 parent f7538f2 commit 516a1fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions library/swift/HeadersBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public class HeadersBuilder: NSObject {
///
/// - parameter headers: The headers with which to start.
required init(headers: [String: [String]]) {

var processedHeaders = [String: KeyValuesPair]()
for (name, values) in headers {
let lowercasedName = name.lowercased()
Expand All @@ -131,7 +130,8 @@ public class HeadersBuilder: NSObject {
/// if the currently processed header name is before the existing header name as
/// determined by an alphabetical order.
if let existing = processedHeaders[lowercasedName], existing.key > name {
processedHeaders[lowercasedName] = KeyValuesPair(key: name, values: values + existing.values)
processedHeaders[lowercasedName] =
KeyValuesPair(key: name, values: values + existing.values)
} else {
processedHeaders[lowercasedName, default: KeyValuesPair(key: name)].appendValues(values)
}
Expand Down
2 changes: 1 addition & 1 deletion test/swift/HeadersBuilderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ final class HeadersBuilderTests: XCTestCase {
XCTAssertEqual(["x-foo": ["abc"]], headers)
}

func testInitializationIsCaseInsensitivePreservesCasingAndProcessesConflictingHeadersInAlphabeticalOrder() {
func testInitializationIsCaseInsensitivePreservesCasingAndProcessesInAlphabeticalOrder() {
let headers = HeadersBuilder(headers: ["a": ["456"], "A": ["123"]])
XCTAssertEqual(["A": ["123", "456"]], headers.headers())
}
Expand Down

0 comments on commit 516a1fc

Please sign in to comment.