mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 06:35:51 +00:00
Use batchCount for indexes passed into internal layout nodes method and NSMaxRange
This commit is contained in:
@@ -167,7 +167,7 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
|||||||
// For any given layout pass that occurs, this method will be called at least twice, once on the main thread and
|
// For any given layout pass that occurs, this method will be called at least twice, once on the main thread and
|
||||||
// the background, to result in complete coverage of both loaded and unloaded nodes
|
// the background, to result in complete coverage of both loaded and unloaded nodes
|
||||||
BOOL isMainThread = ASDisplayNodeThreadIsMain();
|
BOOL isMainThread = ASDisplayNodeThreadIsMain();
|
||||||
for (NSUInteger k = range.location; k < (range.location + range.length); k++) {
|
for (NSUInteger k = range.location; k < NSMaxRange(range); k++) {
|
||||||
ASCellNode *node = nodes[k];
|
ASCellNode *node = nodes[k];
|
||||||
// Only nodes that are loaded should be layout on the main thread
|
// Only nodes that are loaded should be layout on the main thread
|
||||||
if (node.isNodeLoaded == isMainThread) {
|
if (node.isNodeLoaded == isMainThread) {
|
||||||
@@ -220,7 +220,7 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
|||||||
|
|
||||||
[self _layoutNodes:subarray
|
[self _layoutNodes:subarray
|
||||||
fromContexts:contexts
|
fromContexts:contexts
|
||||||
inIndexesOfRange:NSMakeRange(0, subarray.count)
|
inIndexesOfRange:NSMakeRange(0, batchCount)
|
||||||
ofKind:kind];
|
ofKind:kind];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -228,7 +228,7 @@ static void *kASSizingQueueContext = &kASSizingQueueContext;
|
|||||||
[_mainSerialQueue performBlockOnMainThread:^{
|
[_mainSerialQueue performBlockOnMainThread:^{
|
||||||
[self _layoutNodes:subarray
|
[self _layoutNodes:subarray
|
||||||
fromContexts:contexts
|
fromContexts:contexts
|
||||||
inIndexesOfRange:NSMakeRange(0, subarray.count)
|
inIndexesOfRange:NSMakeRange(0, batchCount)
|
||||||
ofKind:kind];
|
ofKind:kind];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user