mirror of
https://github.com/zhigang1992/Kingfisher.git
synced 2026-04-30 13:02:33 +08:00
Fix: avoid unnecessary I/O when building cache file URL
For more details see the discussion on: https://developer.apple.com/documentation/foundation/nsurl/1410614-urlbyappendingpathcomponent Since we know that we're looking for a file and a trailing slash will never be necessary, we can safely use the more specific version of the function
This commit is contained in:
@@ -228,7 +228,7 @@ public enum DiskStorage {
|
||||
/// the `cacheKey` of an image `Source`. It is the computed key with processor identifier considered.
|
||||
public func cacheFileURL(forKey key: String) -> URL {
|
||||
let fileName = cacheFileName(forKey: key)
|
||||
return directoryURL.appendingPathComponent(fileName)
|
||||
return directoryURL.appendingPathComponent(fileName, isDirectory: false)
|
||||
}
|
||||
|
||||
func cacheFileName(forKey key: String) -> String {
|
||||
|
||||
Reference in New Issue
Block a user