Skip to content

Fix warnings in the Foundation build #1258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2017
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion Foundation/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,6 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
@inline(__always)
public func subdata(in range: Range<Index>) -> Data {
_validateRange(range)
let length = count
if count == 0 {
return Data()
}
Expand Down
5 changes: 3 additions & 2 deletions Foundation/HTTPCookieStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ open class HTTPCookieStorage: NSObject {
}

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