-
Notifications
You must be signed in to change notification settings - Fork 448
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
chore(arrow-atomic): Cleanup atomic code #3318
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time, less repetition is always nicer :)
/** | ||
* while (true) as an expression. | ||
*/ | ||
@PublishedApi | ||
internal inline fun forever(block: () -> Unit): Nothing { | ||
while (true) block() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to move this function to some other file, to stress that it's shared between all implementations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me @kyay10.
I've personally never really cared about such code optimisations (in Arrow), since the older code was simpler to understand in exchange for 40 extra lines of code.
@kyay10 I've decided to remove |
Only public api additions are internal helper functions. Some of them might be good to promote to public, but that's up to you!