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

ThreadContextElement for common #4208

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from
Draft

Conversation

zuevmaxim
Copy link
Contributor

Fixes #3326

Uses #4174 as a reference

@Suppress("IMPLICIT_BOXING_IN_IDENTITY_EQUALS")
return when {
countOrElement === 0 -> NO_THREAD_ELEMENTS // very fast path when there are no active ThreadContextElements
// ^^^ identity comparison for speed, we know zero always has the same identity
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this true for non JVM platforms? The code seems correct either way but the comment might be updated if this is platform dependent.

}

// Counts ThreadContextElements in the context
// Any? here is Int | ThreadContextElement (when count is one)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why isn't Any used instead of Any?? Then threadContextElements wouldn't have to use !!.

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.

3 participants