-
Notifications
You must be signed in to change notification settings - Fork 14
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
Clean up some analyzer warnings and mark a method that can return nil #113
Conversation
[self.collectionView moveItemAtIndexPath:indexPath toIndexPath:newIndexPath]; | ||
if (newIndexPath) { | ||
[self.collectionView moveItemAtIndexPath:indexPath toIndexPath:newIndexPath]; | ||
} |
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.
Would it make sense to test newIndexPath
at the top of the NSFetchedResultsChangeMove
case? It's being used in various tests outside of these checks as it is.
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, you're right. I thought it would still need to execute the case on line 285, but that's not true after all.
if (newIndexPath) { | ||
[self.collectionView moveItemAtIndexPath:indexPath toIndexPath:newIndexPath]; | ||
} | ||
[self.collectionView moveItemAtIndexPath:indexPath toIndexPath:newIndexPath]; |
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.
Should this case execute if newIndexPath
is nil
?
if (newIndexPath) { | ||
[self.collectionView moveItemAtIndexPath:indexPath toIndexPath:newIndexPath]; | ||
} | ||
[self.collectionView moveItemAtIndexPath:indexPath toIndexPath:newIndexPath]; |
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.
Ditto.
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.
LGTM
Mostly just nil checks.
Fixes #107.
@vokal/ios-developers cool?