Skip to content
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

Merged
merged 3 commits into from
Nov 14, 2016

Conversation

brockboland
Copy link
Contributor

Mostly just nil checks.

Fixes #107.

@vokal/ios-developers cool?

[self.collectionView moveItemAtIndexPath:indexPath toIndexPath:newIndexPath];
if (newIndexPath) {
[self.collectionView moveItemAtIndexPath:indexPath toIndexPath:newIndexPath];
}
Copy link
Contributor

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.

Copy link
Contributor Author

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];
Copy link
Contributor

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];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Copy link
Contributor

@vokal-isaac vokal-isaac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brockboland brockboland merged commit bd52734 into vokal:master Nov 14, 2016
@brockboland brockboland deleted the analyze branch November 14, 2016 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants