Skip to content

Commit 134d0c8

Browse files
Make ParseModuleCollection initialization not dispatch_async multiple times.
By lifting the `dispatch_async` outside of the module collection enumeration, it allows for fewer local variable caputres, improving perfromance, as well as not requiring multiple flushes of the main dispatch queue to execute.
1 parent 51201d3 commit 134d0c8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Parse/Internal/ParseModule.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ - (NSUInteger)modulesCount {
8181
///--------------------------------------
8282

8383
- (void)parseDidInitializeWithApplicationId:(NSString *)applicationId clientKey:(NSString *)clientKey {
84-
[self enumerateModulesWithBlock:^(id<ParseModule> module, BOOL *stop, BOOL *remove) {
85-
dispatch_async(dispatch_get_main_queue(), ^{
84+
dispatch_async(dispatch_get_main_queue(), ^{
85+
[self enumerateModulesWithBlock:^(id<ParseModule> module, BOOL *stop, BOOL *remove) {
8686
[module parseDidInitializeWithApplicationId:applicationId clientKey:clientKey];
87-
});
88-
}];
87+
}];
88+
});
8989
}
9090

9191
///--------------------------------------

0 commit comments

Comments
 (0)