From 516a1fc66ef5ae924b2e4658ab38b9284d7c6331 Mon Sep 17 00:00:00 2001 From: Rafal Augustyniak Date: Thu, 23 Jun 2022 11:21:02 -0400 Subject: [PATCH] Lint fixes Signed-off-by: Rafal Augustyniak --- library/swift/HeadersBuilder.swift | 4 ++-- test/swift/HeadersBuilderTests.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/swift/HeadersBuilder.swift b/library/swift/HeadersBuilder.swift index 6e21328234..4d496dfd9b 100644 --- a/library/swift/HeadersBuilder.swift +++ b/library/swift/HeadersBuilder.swift @@ -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() @@ -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) } diff --git a/test/swift/HeadersBuilderTests.swift b/test/swift/HeadersBuilderTests.swift index dfc1cb807d..efa2b793c0 100644 --- a/test/swift/HeadersBuilderTests.swift +++ b/test/swift/HeadersBuilderTests.swift @@ -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()) }