-
-
Notifications
You must be signed in to change notification settings - Fork 877
Cleaned up some warnings from the static analyzer #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -638,7 +638,7 @@ NS_REQUIRES_PROPERTY_DEFINITIONS | |||
@param objects The list of objects to fetch. | |||
@param error Pointer to an `NSError` that will be set if necessary. | |||
*/ | |||
+ (void)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects error:(NSError **)error; | |||
+ (instancetype)fetchAllIfNeeded:(PF_NULLABLE NSArray *)objects error:(NSError **)error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should have an NSArray
return type, since the block has an NSArray
as a result.
@@ -1110,7 +1110,7 @@ - (void)mergeFromRESTDictionary:(NSDictionary *)object withDecoder:(PFDecoder *) | |||
if (localOperationSet.updatedAt != nil && | |||
[localOperationSet.updatedAt compare:remoteOperationSet.updatedAt] != NSOrderedAscending) { | |||
[localOperationSet mergeOperationSet:remoteOperationSet]; | |||
} else { | |||
} else if (remoteOperationSet) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is actually very tricky, since remoteOperationSet
should always be here, according to the logic above.
Maybe replace it with PFConsistencyAssert
with a useful error message?
I just checked locally - it actually supresses the analyzer warning if you have an assert here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I wasn't too sure about that either. I'll go ahead and do that instead!
@gonzalonunez, almost there... |
Should've fixed it all. Waiting to make sure Travis doesn't fail. |
Seems to be missing something. Checking over it now. |
Looks like it's related to |
Ow, right... Those methods are declared also in |
Ah, great catch. I'll go ahead and change those now. Thanks for the tip, would've taken me all night! Lol |
@@ -1111,6 +1111,7 @@ - (void)mergeFromRESTDictionary:(NSDictionary *)object withDecoder:(PFDecoder *) | |||
[localOperationSet.updatedAt compare:remoteOperationSet.updatedAt] != NSOrderedAscending) { | |||
[localOperationSet mergeOperationSet:remoteOperationSet]; | |||
} else { | |||
PFConsistencyAssert(remoteOperationSet, @"'remoteOperationSet' should not be nil."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
@gonzalonunez, almost there, a single change around |
Fixed the issue in PFUser.m and squashed the commits 🙌 |
Looks perfect! Merging now! |
Cleaned up some warnings from the static analyzer
Fixes #121