mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-11 05:20:37 +00:00
Merge pull request #1102 from knopp/ASRangeControlller-get-index-paths-optimization
[ASRangeController] don't get index paths twice if tuning parameters …
This commit is contained in:
@@ -109,7 +109,15 @@
|
||||
if (ASInterfaceStateIncludesVisible(selfInterfaceState)) {
|
||||
// If we are already visible, get busy! Better get started on preloading before the user scrolls more...
|
||||
fetchDataIndexPaths = [_layoutController indexPathsForScrolling:_scrollDirection rangeType:ASLayoutRangeTypeFetchData];
|
||||
displayIndexPaths = [_layoutController indexPathsForScrolling:_scrollDirection rangeType:ASLayoutRangeTypeDisplay];
|
||||
|
||||
ASRangeTuningParameters parametersFetchData = [_layoutController tuningParametersForRangeType:ASLayoutRangeTypeFetchData];
|
||||
ASRangeTuningParameters parametersDisplay = [_layoutController tuningParametersForRangeType:ASLayoutRangeTypeDisplay];
|
||||
if (parametersDisplay.leadingBufferScreenfuls == parametersFetchData.leadingBufferScreenfuls &&
|
||||
parametersDisplay.trailingBufferScreenfuls == parametersFetchData.trailingBufferScreenfuls) {
|
||||
displayIndexPaths = fetchDataIndexPaths;
|
||||
} else {
|
||||
displayIndexPaths = [_layoutController indexPathsForScrolling:_scrollDirection rangeType:ASLayoutRangeTypeDisplay];
|
||||
}
|
||||
|
||||
// Typically the fetchDataIndexPaths will be the largest, and be a superset of the others, though it may be disjoint.
|
||||
// Because allIndexPaths is an NSMutableOrderedSet, this adds the non-duplicate items /after/ the existing items.
|
||||
|
||||
Reference in New Issue
Block a user