diff --git a/Tusker/Caching/Cache.swift b/Tusker/Caching/Cache.swift index efa0c02c..5a38e9e8 100644 --- a/Tusker/Caching/Cache.swift +++ b/Tusker/Caching/Cache.swift @@ -15,6 +15,7 @@ enum Cache { case disk(DiskStorage) case hybrid(HybridStorage) + @available(*, deprecated, message: "disk-based caches synchronously interact with the file system. Avoid using if possible.") func existsObject(forKey key: String) throws -> Bool { switch self { case let .memory(memory): diff --git a/Tusker/Caching/ImageCache.swift b/Tusker/Caching/ImageCache.swift index fcd4052c..792fda47 100644 --- a/Tusker/Caching/ImageCache.swift +++ b/Tusker/Caching/ImageCache.swift @@ -38,8 +38,7 @@ class ImageCache { func get(_ url: URL, completion: ((Data?) -> Void)?) -> Request? { let key = url.absoluteString - if (try? cache.existsObject(forKey: key)) ?? false, - let data = try? cache.object(forKey: key) { + if let data = try? cache.object(forKey: key) { completion?(data) return nil } else {