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

Readability improvements in ASDataController #trivial #1067

Merged
merged 1 commit into from
Aug 6, 2018

Conversation

Adlai-Holler
Copy link
Member

I'm working on a new optional feature in data controller and it would be good to clear the deck before that patch.

Essentially the measurement pass is synchronous but it's treated as asynchronous. Patch that up. Also, ASCollectionElement never returns nil from node, so remove that check and also some retain/releases.

ASCellNode *node = context.node;
if (node == nil) {
ASDisplayNodeAssertNotNil(node, @"Node block created nil node; %@, %@", self, strongDataSource);
node = [[ASCellNode alloc] init]; // Fallback to avoid crash for production apps.
Copy link
Member Author

Choose a reason for hiding this comment

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

I know this is scary, but the exact same assertion and side-path lives inside ASCollectionElement. That class never returns nil from node.

Copy link
Member

@appleguy appleguy left a comment

Choose a reason for hiding this comment

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

Good to go!

@appleguy appleguy merged commit 2bb216b into master Aug 6, 2018
@Adlai-Holler Adlai-Holler deleted the AHSimplerDataController branch August 6, 2018 00:25
mikezucc pushed a commit to mikezucc/Texture that referenced this pull request Oct 2, 2018
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