replace alloc] init] -> new]

Summary:
Issue fixed: #822

As rnystrom would've said: Go 💚
Closes https://github.com/Instagram/IGListKit/pull/823

Differential Revision: D5301864

Pulled By: rnystrom

fbshipit-source-id: c7a0f62b91712a54ee75ee0d1fe62b8611745e37
This commit is contained in:
Viktor Gardart 2017-06-22 09:21:50 -07:00 committed by Facebook Github Bot
parent 8073736772
commit 95367bb6a4
4 changed files with 10 additions and 10 deletions

View file

@ -46,7 +46,7 @@
NSMapTable *table = [[NSMapTable alloc] initWithKeyPointerFunctions:keyFunctions valuePointerFunctions:valueFunctions capacity:0];
_sectionMap = [[IGListSectionMap alloc] initWithMapTable:table];
_displayHandler = [[IGListDisplayHandler alloc] init];
_displayHandler = [IGListDisplayHandler new];
_workingRangeHandler = [[IGListWorkingRangeHandler alloc] initWithWorkingRangeSize:workingRangeSize];
_viewSectionControllerMap = [NSMapTable mapTableWithKeyOptions:NSMapTableObjectPointerPersonality | NSMapTableStrongMemory
@ -330,7 +330,7 @@
IGAssertMainThread();
IGParameterAssert(objects);
NSMutableIndexSet *sections = [[NSMutableIndexSet alloc] init];
NSMutableIndexSet *sections = [NSMutableIndexSet new];
// use the item map based on whether or not we're in an update block
IGListSectionMap *map = [self sectionMapUsingPreviousIfInUpdateBlock:YES];
@ -605,7 +605,7 @@
- (NSArray<NSIndexPath *> *)indexPathsFromSectionController:(IGListSectionController *)sectionController
indexes:(NSIndexSet *)indexes
usePreviousIfInUpdateBlock:(BOOL)usePreviousIfInUpdateBlock {
NSMutableArray<NSIndexPath *> *indexPaths = [[NSMutableArray alloc] init];
NSMutableArray<NSIndexPath *> *indexPaths = [NSMutableArray new];
IGListSectionMap *map = [self sectionMapUsingPreviousIfInUpdateBlock:usePreviousIfInUpdateBlock];
const NSInteger section = [map sectionForSectionController:sectionController];
@ -632,7 +632,7 @@
- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForIndexPath:(NSIndexPath *)indexPath
supplementaryKinds:(NSArray<NSString *> *)supplementaryKinds {
UICollectionViewLayout *layout = self.collectionView.collectionViewLayout;
NSMutableArray<UICollectionViewLayoutAttributes *> *attributes = [[NSMutableArray alloc] init];
NSMutableArray<UICollectionViewLayoutAttributes *> *attributes = [NSMutableArray new];
UICollectionViewLayoutAttributes *cellAttributes = [layout layoutAttributesForItemAtIndexPath:indexPath];
if (cellAttributes) {

View file

@ -300,7 +300,7 @@ static void adjustZIndexForAttributes(UICollectionViewLayoutAttributes *attribut
if (_stickyHeaderOriginYAdjustment != stickyHeaderOriginYAdjustment) {
_stickyHeaderOriginYAdjustment = stickyHeaderOriginYAdjustment;
IGListCollectionViewLayoutInvalidationContext *invalidationContext = [[IGListCollectionViewLayoutInvalidationContext alloc] init];
IGListCollectionViewLayoutInvalidationContext *invalidationContext = [IGListCollectionViewLayoutInvalidationContext new];
invalidationContext.ig_invalidateSupplementaryAttributes = YES;
[self invalidateLayoutWithContext:invalidationContext];
}

View file

@ -51,7 +51,7 @@ static void * kStackedSectionControllerIndexKey = &kStackedSectionControllerInde
sectionController.viewController = self.viewController;
}
_visibleSectionControllers = [[NSCountedSet alloc] init];
_visibleSectionControllers = [NSCountedSet new];
_sectionControllers = [NSOrderedSet orderedSetWithArray:sectionControllers];
self.displayDelegate = self;
@ -65,8 +65,8 @@ static void * kStackedSectionControllerIndexKey = &kStackedSectionControllerInde
#pragma mark - Private API
- (void)reloadData {
NSMutableArray *sectionControllers = [[NSMutableArray alloc] init];
NSMutableArray *offsets = [[NSMutableArray alloc] init];
NSMutableArray *sectionControllers = [NSMutableArray new];
NSMutableArray *offsets = [NSMutableArray new];
NSInteger numberOfItems = 0;
for (IGListSectionController *sectionController in self.sectionControllers) {
@ -111,7 +111,7 @@ static void * kStackedSectionControllerIndexKey = &kStackedSectionControllerInde
- (NSIndexSet *)itemIndexesForSectionController:(IGListSectionController *)sectionController indexes:(NSIndexSet *)indexes {
const NSInteger offset = [self offsetForSectionController:sectionController];
NSMutableIndexSet *itemIndexes = [[NSMutableIndexSet alloc] init];
NSMutableIndexSet *itemIndexes = [NSMutableIndexSet new];
[indexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) {
[itemIndexes addIndex:(idx + offset)];
}];

View file

@ -25,7 +25,7 @@
- (instancetype)init {
if (self = [super init]) {
_visibleListSections = [[NSCountedSet alloc] init];
_visibleListSections = [NSCountedSet new];
_visibleViewObjectMap = [[NSMapTable alloc] initWithKeyOptions:NSMapTableStrongMemory valueOptions:NSMapTableStrongMemory capacity:0];
}
return self;