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

关于 force_inline的疑问 #18

Closed
RSComponent opened this issue Apr 26, 2018 · 4 comments
Closed

关于 force_inline的疑问 #18

RSComponent opened this issue Apr 26, 2018 · 4 comments

Comments

@RSComponent
Copy link

您好,在您的代码中有一个强制内联的函数
static force_inline NSString *LSAnimatorChainAnimationKey(NSInteger index) {
return [NSString stringWithFormat:@"%@_%@", kLSAnimatorKey, @(index)];
}
这里我有一个疑问,为什么要强制内联呢?非常期待您的回复

@Lision
Copy link
Owner

Lision commented Apr 26, 2018

Emmmmm... 因为这个方法没必要跳堆栈 提高效率

@RSComponent
Copy link
Author

那如果用inline,而不是强制内联呢?inline和force inline有什么区别呢?

@Lision
Copy link
Owner

Lision commented May 2, 2018

@Lision Lision closed this as completed May 2, 2018
@Lision
Copy link
Owner

Lision commented May 25, 2018

现在已经用 NS_INLINE 替换了 force inline

@Lision Lision reopened this May 25, 2018
@Lision Lision closed this as completed Jun 4, 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

No branches or pull requests

2 participants