Remove unncessary batch layout calls in ASCollectionDataController

- These calls cause supplementary nodes to be allocated and laid out, but not inserted afterward. So the nodes are thrown away.
- Next time when it is the right time to allocate these nodes, it is the second allocation request and triggers assertion in ASIndexedNodeContext #1296.
This commit is contained in:
Huy Nguyen
2016-03-01 15:42:49 -08:00
parent c3f7197bf3
commit 5ecc9b16a9

View File

@@ -46,9 +46,6 @@
NSMutableArray<ASIndexedNodeContext *> *contexts = [NSMutableArray array];
[self _populateSupplementaryNodesOfKind:kind withMutableContexts:contexts];
_pendingContexts[kind] = contexts;
// Measure loaded nodes before leaving the main thread
[self batchLayoutNodesFromContexts:contexts ofKind:kind completion:nil];
}
}
@@ -85,9 +82,6 @@
NSMutableArray<ASIndexedNodeContext *> *contexts = [NSMutableArray array];
[self _populateSupplementaryNodesOfKind:kind withSections:sections mutableContexts:contexts];
_pendingContexts[kind] = contexts;
// Measure loaded nodes before leaving the main thread
[self batchLayoutNodesFromContexts:contexts ofKind:kind completion:nil];
}
}
@@ -123,9 +117,6 @@
NSMutableArray<ASIndexedNodeContext *> *contexts = [NSMutableArray array];
[self _populateSupplementaryNodesOfKind:kind withSections:sections mutableContexts:contexts];
_pendingContexts[kind] = contexts;
// Measure loaded nodes before leaving the main thread
[self batchLayoutNodesFromContexts:contexts ofKind:kind completion:nil];
}
}