|
|
@@ -201,10 +201,8 @@ public extension ImageCache {
|
|
|
}
|
|
|
|
|
|
self.fileManager.createFileAtPath(self.cachePathForKey(key), contents: data, attributes: nil)
|
|
|
- callHandlerInMainQueue()
|
|
|
- } else {
|
|
|
- callHandlerInMainQueue()
|
|
|
}
|
|
|
+ callHandlerInMainQueue()
|
|
|
})
|
|
|
} else {
|
|
|
callHandlerInMainQueue()
|
|
|
@@ -493,9 +491,7 @@ extension ImageCache {
|
|
|
NSNotificationCenter.defaultCenter().postNotificationName(KingfisherDidCleanDiskCacheNotification, object: self, userInfo: [KingfisherDiskCacheCleanedHashKey: cleanedHashes])
|
|
|
}
|
|
|
|
|
|
- if let completionHandler = completionHandler {
|
|
|
- completionHandler()
|
|
|
- }
|
|
|
+ completionHandler?()
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
@@ -580,7 +576,7 @@ public extension ImageCache {
|
|
|
|
|
|
- parameter completionHandler: Called with the calculated size when finishes.
|
|
|
*/
|
|
|
- public func calculateDiskCacheSizeWithCompletionHandler(completionHandler: ((size: UInt) -> ())?) {
|
|
|
+ public func calculateDiskCacheSizeWithCompletionHandler(completionHandler: ((size: UInt) -> ())) {
|
|
|
dispatch_async(ioQueue, { () -> Void in
|
|
|
let diskCacheURL = NSURL(fileURLWithPath: self.diskCachePath)
|
|
|
|
|
|
@@ -609,9 +605,7 @@ public extension ImageCache {
|
|
|
}
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), { () -> Void in
|
|
|
- if let completionHandler = completionHandler {
|
|
|
- completionHandler(size: diskCacheSize)
|
|
|
- }
|
|
|
+ completionHandler(size: diskCacheSize)
|
|
|
})
|
|
|
})
|
|
|
}
|