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

Reduce startup time. #1293

Merged
merged 1 commit into from
Jan 17, 2019
Merged

Reduce startup time. #1293

merged 1 commit into from
Jan 17, 2019

Conversation

dmaclach
Copy link
Contributor

Move file level static into a function so that it isn't being initialized pre-main.

- (void)setAsyncdisplaykit_context:(ASBasicImageDownloaderContext *)asyncdisplaykit_context
{
objc_setAssociatedObject(self, kContextKey, asyncdisplaykit_context, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
objc_setAssociatedObject(self, ContextKey(), asyncdisplaykit_context, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest instead of using a static const let's use the selector instead:

objc_setAssociatedObject(self, @selector(asyncdisplaykit_context), asyncdisplaykit_context, OBJC_ASSOCIATION_RETAIN_NONATOMIC);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.. I kept the function just because I felt it better documented what we were doing with the Selector.

Move file level static into a function so that it isn't being initialized pre-main.
@dmaclach
Copy link
Contributor Author

ping?

Copy link
Member

@nguyenhuy nguyenhuy left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you, @dmaclach.

@nguyenhuy nguyenhuy merged commit 0a48cd7 into TextureGroup:master Jan 17, 2019
raviTokopedia pushed a commit to raviTokopedia/Texture that referenced this pull request Mar 5, 2020
Move file level static into a function so that it isn't being initialized pre-main.

(cherry picked from commit 0a48cd7)
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

3 participants