File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed
Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -64,26 +64,14 @@ - (void)executePendingOperationsIfNeeded:(nonnull RNSStackNavigationController *
6464 [_pendingPushOperations removeAllObjects ];
6565}
6666
67- - (NSMutableArray <id<RNSStackOperation>> *)orderedOperations : (nonnull NSMutableArray <id<RNSStackOperation>> *)operations
68- withIndicesFrom :
69- (nonnull NSMutableArray <RNSStackScreenComponentView *> *)stackScreens
67+ - (NSArray <id<RNSStackOperation>> *)orderedOperations : (nonnull NSMutableArray <id<RNSStackOperation>> *)operations
68+ withIndicesFrom :
69+ (nonnull NSMutableArray <RNSStackScreenComponentView *> *)stackScreens
7070{
71- NSMutableArray <NSDictionary *> *operationsWithIndices = [NSMutableArray array ];
72- for (id <RNSStackOperation> operation in operations) {
73- NSInteger index = [stackScreens indexOfObject: operation.stackScreen];
74- [operationsWithIndices addObject: @{@" index" : @(index), @" operation" : operation}];
75- }
76-
77- [operationsWithIndices sortUsingComparator: ^NSComparisonResult (NSDictionary *obj1, NSDictionary *obj2) {
78- return [obj1[@" index" ] compare: obj2[@" index" ]];
71+ return [operations sortedArrayUsingComparator: ^NSComparisonResult (id <RNSStackOperation> obj1,
72+ id <RNSStackOperation> obj2) {
73+ return [@([stackScreens indexOfObject: obj1.stackScreen]) compare: @([stackScreens indexOfObject: obj2.stackScreen])];
7974 }];
80-
81- NSMutableArray <id <RNSStackOperation>> *orderedOperations = [NSMutableArray new ];
82- for (NSDictionary *dict in operationsWithIndices) {
83- [orderedOperations addObject: dict[@" operation" ]];
84- }
85-
86- return orderedOperations;
8775}
8876
8977@end
You can’t perform that action at this time.
0 commit comments