mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
Avoid accessing itemCountsFromDataSource off-main (#2106)
This commit is contained in:
@@ -65,7 +65,10 @@
|
||||
[self deleteSectionsOfKind:kind atIndexSet:indexSet completion:nil];
|
||||
|
||||
// Insert each section
|
||||
NSUInteger sectionCount = self.itemCountsFromDataSource.size();
|
||||
NSUInteger sectionCount = 0;
|
||||
for (ASIndexedNodeContext *context in contexts) {
|
||||
sectionCount = MAX(sectionCount, context.indexPath.section + 1);
|
||||
}
|
||||
NSMutableArray *sections = [NSMutableArray arrayWithCapacity:sectionCount];
|
||||
for (int i = 0; i < sectionCount; i++) {
|
||||
[sections addObject:[NSMutableArray array]];
|
||||
|
||||
Reference in New Issue
Block a user