This repository was archived by the owner on Feb 2, 2023. It is now read-only.
[ASDisplayNode+AsyncDisplay.mm] Refactor display block creation method for conciseness and readability. #1933
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@johnepinterest @maicki @Adlai-Holler @chrisdanford @hannahmbanana
Hey all - this method had grown a bit over time, as features like instance method display were added, and it was time for cleanup.
I took time to do this carefully enough that I feel regressions are unlikely once it has been fully tested with the app, which I'll do over the weekend. I am very familiar with the original state of the code.
I'd like to switch the order of the if / else so that rasterization comes second, but didn't want to move it for now so the diff has a slight element of readability lol.
This should improve efficiency by eliminating several lock acquisitions, and also adding a few strategically relevant isCancelled checks. Particularly on the slowest devices with fast user input / large amounts of content moving (like on iPhone 4 with fast scrolling), I think this could make an incremental difference.