Skip to content

Commit 21fb8e7

Browse files
authored
Merge pull request #1258 from pushkarnk/fix-warnings
2 parents 0e68e5f + 8711fda commit 21fb8e7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Foundation/Data.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,6 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
15901590
@inline(__always)
15911591
public func subdata(in range: Range<Index>) -> Data {
15921592
_validateRange(range)
1593-
let length = count
15941593
if count == 0 {
15951594
return Data()
15961595
}

Foundation/HTTPCookieStorage.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ open class HTTPCookieStorage: NSObject {
7777
}
7878

7979
private func loadPersistedCookies() {
80-
guard let cookies = NSMutableDictionary(contentsOfFile: cookieFilePath) else { return }
81-
var cookies0 = _SwiftValue.fetch(cookies) as? [String: [String: Any]] ?? [:]
80+
guard let cookiesData = try? Data(contentsOf: URL(fileURLWithPath: cookieFilePath)) else { return }
81+
guard let cookies = try? PropertyListSerialization.propertyList(from: cookiesData, format: nil) else { return }
82+
var cookies0 = cookies as? [String: [String: Any]] ?? [:]
8283
self.syncQ.sync {
8384
for key in cookies0.keys {
8485
if let cookie = createCookie(cookies0[key]!) {

0 commit comments

Comments
 (0)