From 223cac1784eb317995f82ce817e775a65bc2049a Mon Sep 17 00:00:00 2001 From: Levi McCallum Date: Sun, 6 Dec 2015 21:30:55 -0800 Subject: [PATCH] Inline supplementary kind iteration in data controller --- .../Details/ASCollectionDataController.mm | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/AsyncDisplayKit/Details/ASCollectionDataController.mm b/AsyncDisplayKit/Details/ASCollectionDataController.mm index 729b998d77..e8028161d6 100644 --- a/AsyncDisplayKit/Details/ASCollectionDataController.mm +++ b/AsyncDisplayKit/Details/ASCollectionDataController.mm @@ -40,8 +40,7 @@ - (void)prepareForReloadData { - NSArray *kinds = [self supplementaryKinds]; - for (NSString *kind in kinds) { + for (NSString *kind in [self supplementaryKinds]) { LOG(@"Populating elements of kind: %@", kind); NSMutableArray *indexPaths = [NSMutableArray array]; NSMutableArray *nodes = [NSMutableArray array]; @@ -83,8 +82,7 @@ - (void)prepareForInsertSections:(NSIndexSet *)sections { - NSArray *kinds = [self supplementaryKinds]; - for (NSString *kind in kinds) { + for (NSString *kind in [self supplementaryKinds]) { LOG(@"Populating elements of kind: %@, for sections: %@", kind, sections); NSMutableArray *nodes = [NSMutableArray array]; NSMutableArray *indexPaths = [NSMutableArray array]; @@ -116,8 +114,7 @@ - (void)willDeleteSections:(NSIndexSet *)sections { - NSArray *kinds = [self supplementaryKinds]; - for (NSString *kind in kinds) { + for (NSString *kind in [self supplementaryKinds]) { NSArray *indexPaths = ASIndexPathsForMultidimensionalArrayAtIndexSet([self editingNodesOfKind:kind], sections); [self deleteNodesOfKind:kind atIndexPaths:indexPaths completion:nil]; @@ -127,8 +124,7 @@ - (void)prepareForReloadSections:(NSIndexSet *)sections { - NSArray *kinds = [self supplementaryKinds]; - for (NSString *kind in kinds) { + for (NSString *kind in [self supplementaryKinds]) { NSMutableArray *nodes = [NSMutableArray array]; NSMutableArray *indexPaths = [NSMutableArray array]; [self _populateSupplementaryNodesOfKind:kind withSections:sections mutableNodes:nodes mutableIndexPaths:indexPaths]; @@ -154,8 +150,7 @@ - (void)willMoveSection:(NSInteger)section toSection:(NSInteger)newSection { - NSArray *kinds = [self supplementaryKinds]; - for (NSString *kind in kinds) { + for (NSString *kind in [self supplementaryKinds]) { NSArray *indexPaths = ASIndexPathsForMultidimensionalArrayAtIndexSet([self editingNodesOfKind:kind], [NSIndexSet indexSetWithIndex:section]); NSArray *nodes = ASFindElementsInMultidimensionalArrayAtIndexPaths([self editingNodesOfKind:kind], indexPaths); [self deleteNodesOfKind:kind atIndexPaths:indexPaths completion:nil];