perf: shortcircuit scrollingImageView
This commit is contained in:
@@ -1421,6 +1421,7 @@ extension ViewController: UICollectionViewDataSource, UICollectionViewDelegateFl
|
||||
withReuseIdentifier: "ScrollingImageCell", for: indexPath
|
||||
)
|
||||
as! ScrollingImageCell
|
||||
if mode != .scroll { return cell }
|
||||
if metadata == nil {
|
||||
print("metadata is nil, should probably not be the case")
|
||||
return cell
|
||||
@@ -1599,6 +1600,7 @@ class ImageLoader {
|
||||
}
|
||||
|
||||
if let completion = completion {
|
||||
assert(loadingTasks[key] == nil)
|
||||
loadingTasks[key] = completion
|
||||
}
|
||||
if let existing = activeTokens[key], !existing.isCancelled {
|
||||
|
||||
Reference in New Issue
Block a user