Skip to content

Commit cc76316

Browse files
authored
Merge pull request #2051 from Alexander-Ignition/master
2 parents 5ffa3c8 + 512cb1d commit cc76316

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

Foundation/HTTPCookieStorage.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ extension HTTPCookie {
3636
*/
3737
open class HTTPCookieStorage: NSObject {
3838

39-
/* both sharedStorage and sharedCookieStorages are synchronized on sharedSyncQ */
40-
private static var sharedStorage: HTTPCookieStorage?
39+
private static let sharedStorage = HTTPCookieStorage(cookieStorageName: "shared")
4140
private static var sharedCookieStorages: [String: HTTPCookieStorage] = [:] //for group storage containers
4241
private static let sharedSyncQ = DispatchQueue(label: "org.swift.HTTPCookieStorage.sharedSyncQ")
4342

@@ -121,14 +120,7 @@ open class HTTPCookieStorage: NSObject {
121120
which will not be shared with other applications.
122121
*/
123122
open class var shared: HTTPCookieStorage {
124-
get {
125-
return sharedSyncQ.sync {
126-
if sharedStorage == nil {
127-
sharedStorage = HTTPCookieStorage(cookieStorageName: "shared")
128-
}
129-
return sharedStorage!
130-
}
131-
}
123+
return sharedStorage
132124
}
133125

134126
/*!

0 commit comments

Comments
 (0)