@@ -401,7 +401,7 @@ + (BFTask *)_deepSaveAsync:(id)object withCurrentUser:(PFUser *)currentUser sess
401401 // TODO: (nlutsenko) Get rid of this once we allow localIds in batches.
402402 NSArray *remaining = [uniqueObjects allObjects ];
403403 NSMutableArray *finished = [NSMutableArray array ];
404- while ([ remaining count ] > 0 ) {
404+ while (remaining. count > 0 ) {
405405 // Partition the objects into two sets: those that can be save immediately,
406406 // and those that rely on other objects to be created first.
407407 NSMutableArray *current = [NSMutableArray array ];
@@ -429,7 +429,7 @@ + (BFTask *)_deepSaveAsync:(id)object withCurrentUser:(PFUser *)currentUser sess
429429 // This has to happen separately from everything else because there [PFUser save]
430430 // is special-cased to work for lazy users, but new users can't be created by
431431 // PFMultiCommand's regular save.
432- if ([ currentUser isLazy ] && [current containsObject: currentUser]) {
432+ if (currentUser. isLazy && [current containsObject: currentUser]) {
433433 task = [task continueAsyncWithSuccessBlock: ^id (BFTask *task) {
434434 return [currentUser saveInBackground ];
435435 }];
@@ -447,12 +447,12 @@ + (BFTask *)_deepSaveAsync:(id)object withCurrentUser:(PFUser *)currentUser sess
447447 // and execute them concurrently with a wrapper task for all of them.
448448 NSArray *objectBatches = [PFInternalUtils arrayBySplittingArray: current
449449 withMaximumComponentsPerSegment: PFRESTObjectBatchCommandSubcommandsLimit];
450- NSMutableArray *tasks = [NSMutableArray arrayWithCapacity: [ objectBatches count ] ];
450+ NSMutableArray *tasks = [NSMutableArray arrayWithCapacity: objectBatches. count];
451451
452452 for (NSArray *objectBatch in objectBatches) {
453453 BFTask *batchTask = [self _enqueue: ^BFTask *(BFTask *toAwait) {
454454 return [toAwait continueAsyncWithBlock: ^id (BFTask *task) {
455- NSMutableArray *commands = [NSMutableArray arrayWithCapacity: [ objectBatch count ] ];
455+ NSMutableArray *commands = [NSMutableArray arrayWithCapacity: objectBatch. count];
456456 for (PFObject *object in objectBatch) {
457457 PFRESTCommand *command = nil ;
458458 @synchronized ([object lock ]) {
@@ -472,7 +472,7 @@ + (BFTask *)_deepSaveAsync:(id)object withCurrentUser:(PFUser *)currentUser sess
472472 continueAsyncWithBlock: ^id (BFTask *commandRunnerTask) {
473473 NSArray *results = [commandRunnerTask.result result ];
474474
475- NSMutableArray *handleSaveTasks = [NSMutableArray arrayWithCapacity: [ objectBatch count ] ];
475+ NSMutableArray *handleSaveTasks = [NSMutableArray arrayWithCapacity: objectBatch. count];
476476
477477 __block NSError *error = task.error ;
478478 [objectBatch enumerateObjectsUsingBlock: ^(PFObject *object, NSUInteger idx, BOOL *stop) {
@@ -565,10 +565,10 @@ + (BFTask *)_enqueueSaveEventuallyChildrenOfObject:(PFObject *)object
565565 // Remove object from the queue of objects to save as this method should only save children.
566566 [uniqueObjects removeObject: object];
567567
568- NSArray *remaining = [ uniqueObjects allObjects ] ;
568+ NSArray *remaining = uniqueObjects. allObjects ;
569569 NSMutableArray *finished = [NSMutableArray array ];
570570 NSMutableArray *enqueueTasks = [NSMutableArray array ];
571- while ([ remaining count ] > 0 ) {
571+ while (remaining. count > 0 ) {
572572 // Partition the objects into two sets: those that can be save immediately,
573573 // and those that rely on other objects to be created first.
574574 NSMutableArray *current = [NSMutableArray array ];
@@ -600,7 +600,7 @@ + (BFTask *)_enqueueSaveEventuallyChildrenOfObject:(PFObject *)object
600600 // Unfortunately, ACLs with lazy users still cannot be saved, because the ACL does
601601 // does not get updated after the user save completes.
602602 // TODO: (nlutsenko) Make the ACL update after the user is saved.
603- if ([ currentUser isLazy ] && [current containsObject: currentUser]) {
603+ if (currentUser. isLazy && [current containsObject: currentUser]) {
604604 [enqueueTasks addObject: [currentUser _enqueueSaveEventuallyWithChildren: NO ]];
605605 [finished addObject: currentUser];
606606 [current removeObject: currentUser];
@@ -941,7 +941,7 @@ - (void)mergeFromRESTDictionary:(NSDictionary *)object withDecoder:(PFDecoder *)
941941 if ([key isEqualToString: PFObjectOperationsRESTKey]) {
942942 PFOperationSet *remoteOperationSet = nil ;
943943 NSArray *operations = (NSArray *)obj;
944- if ([ operations count ] > 0 ) {
944+ if (operations. count > 0 ) {
945945 // Add and enqueue any saveEventually operations, roll forward any other
946946 // operations sets (operations sets here are generally failed/incomplete saves).
947947 PFOperationSet *current = nil ;
@@ -957,7 +957,7 @@ - (void)mergeFromRESTDictionary:(NSDictionary *)object withDecoder:(PFDecoder *)
957957 // Check if queue already contains this operation set and discard it if does
958958 if (![self _containsOperationSet: operationSet]) {
959959 // Insert the `saveEventually` operationSet before the last operation set at all times.
960- NSUInteger index = ([ operationSetQueue count ] == 0 ? 0 : [ operationSetQueue count ] - 1 );
960+ NSUInteger index = (operationSetQueue. count == 0 ? 0 : operationSetQueue. count - 1 );
961961 [operationSetQueue insertObject: operationSet atIndex: index];
962962 [self _enqueueSaveEventuallyOperationAsync: operationSet];
963963 }
@@ -1187,7 +1187,7 @@ - (BOOL)_containsOperationSet:(PFOperationSet *)operationSet {
11871187 */
11881188- (PFOperationSet *)unsavedChanges {
11891189 @synchronized (lock) {
1190- return [ operationSetQueue lastObject ] ;
1190+ return operationSetQueue. lastObject ;
11911191 }
11921192}
11931193
@@ -1207,7 +1207,7 @@ - (BOOL)_hasChanges {
12071207- (BOOL )_hasOutstandingOperations {
12081208 @synchronized (lock) {
12091209 // > 1 since 1 is unsaved changes.
1210- return [ operationSetQueue count ] > 1 ;
1210+ return operationSetQueue. count > 1 ;
12111211 }
12121212}
12131213
@@ -1254,9 +1254,9 @@ - (void)removeOldKeysAfterFetch:(NSDictionary *)result {
12541254 PFMutableObjectState *state = [self ._state mutableCopy ];
12551255
12561256 NSMutableDictionary *removedDictionary = [NSMutableDictionary dictionaryWithDictionary: state.serverData];
1257- [removedDictionary removeObjectsForKeys: [ result allKeys ] ];
1257+ [removedDictionary removeObjectsForKeys: result. allKeys];
12581258
1259- NSArray *removedKeys = [ removedDictionary allKeys ] ;
1259+ NSArray *removedKeys = removedDictionary. allKeys ;
12601260 [state removeServerDataObjectsForKeys: removedKeys];
12611261 [_availableKeys minusSet: [NSSet setWithArray: removedKeys]];
12621262
@@ -1321,7 +1321,7 @@ - (void)_mergeFromServerWithResult:(NSDictionary *)result decoder:(PFDecoder *)d
13211321 state.updatedAt = state.createdAt ;
13221322 }
13231323 self._state = state;
1324- [_availableKeys addObjectsFromArray: [ result allKeys ] ];
1324+ [_availableKeys addObjectsFromArray: result. allKeys];
13251325
13261326 dirty = NO ;
13271327 }
@@ -1969,7 +1969,7 @@ - (BOOL)isDirty {
19691969
19701970- (BOOL )isDirtyForKey : (NSString *)key {
19711971 @synchronized (lock) {
1972- return [self unsavedChanges ][key] != nil ;
1972+ return ( [self unsavedChanges ][key] != nil ) ;
19731973 }
19741974}
19751975
@@ -2200,12 +2200,12 @@ - (void)removeObjectForKey:(NSString *)key {
22002200- (void )revert {
22012201 @synchronized (self.lock ) {
22022202 if (self.dirty ) {
2203- NSMutableSet *persistentKeys = [NSMutableSet setWithArray: [ self ._state.serverData allKeys ] ];
2203+ NSMutableSet *persistentKeys = [NSMutableSet setWithArray: self ._state.serverData. allKeys];
22042204
22052205 PFOperationSet *unsavedChanges = [self unsavedChanges ];
22062206 for (PFOperationSet *operationSet in operationSetQueue) {
22072207 if (operationSet != unsavedChanges) {
2208- [persistentKeys addObjectsFromArray: [ operationSet.keyEnumerator allObjects ] ];
2208+ [persistentKeys addObjectsFromArray: operationSet.keyEnumerator. allObjects];
22092209 }
22102210 }
22112211
@@ -2301,7 +2301,7 @@ - (void)setValue:(id)value forUndefinedKey:(NSString *)key {
23012301
23022302- (NSArray *)allKeys {
23032303 @synchronized (lock) {
2304- return [ _estimatedData allKeys ] ;
2304+ return _estimatedData. allKeys ;
23052305 }
23062306}
23072307
@@ -2321,7 +2321,7 @@ - (NSString *)description {
23212321- (NSString *)_recursiveDescription {
23222322 @synchronized (lock) {
23232323 return [NSString stringWithFormat: @" %@ %@ " ,
2324- [self _flatDescription ], [ _estimatedData.dictionaryRepresentation description ] ];
2324+ [self _flatDescription ], _estimatedData.dictionaryRepresentation. description];
23252325 }
23262326}
23272327
@@ -2435,13 +2435,13 @@ + (BOOL)resolveInstanceMethod:(SEL)sel {
24352435 }
24362436
24372437 // Convert the method signature *back* into a objc type string (sidenote, why isn't this a built in?).
2438- NSMutableString *typeString = [NSMutableString stringWithFormat: @" %s " , [ signature methodReturnType ] ];
2439- for (NSUInteger argumentIndex = 0 ; argumentIndex < [ signature numberOfArguments ] ; argumentIndex++) {
2438+ NSMutableString *typeString = [NSMutableString stringWithFormat: @" %s " , signature. methodReturnType];
2439+ for (NSUInteger argumentIndex = 0 ; argumentIndex < signature. numberOfArguments ; argumentIndex++) {
24402440 [typeString appendFormat: @" %s " , [signature getArgumentTypeAtIndex: argumentIndex]];
24412441 }
24422442
24432443 // TODO: (richardross) Support stret return here (will need to introspect the method signature to do so).
2444- class_addMethod (self, sel, _objc_msgForward, [ typeString UTF8String ] );
2444+ class_addMethod (self, sel, _objc_msgForward, typeString. UTF8String );
24452445
24462446 return YES ;
24472447}
0 commit comments