Skip to content

FastThreadLocal#set remove duplicate isIndexedVariableSet call#7541

Merged
Scottmitch merged 1 commit intonetty:4.1from
Scottmitch:thread_local
Dec 22, 2017
Merged

FastThreadLocal#set remove duplicate isIndexedVariableSet call#7541
Scottmitch merged 1 commit intonetty:4.1from
Scottmitch:thread_local

Conversation

@Scottmitch
Copy link
Copy Markdown
Member

Motivation:
FastThreadLocal#set calls isIndexedVariableSet to determine if we need to register with the cleaner, but the set(InternalThreadLocalMap, V) method will also internally do this check so we can share code and only do the check a single time.

Modifications:

  • extract code from set(InternalThreadLocalMap, V) so it can be called externally to determine if a new item was created

Result:
Less code duplication in FastThreadLocal#set.

Motivation:
FastThreadLocal#set calls isIndexedVariableSet to determine if we need to register with the cleaner, but the set(InternalThreadLocalMap, V) method will also internally do this check so we can share code and only do the check a single time.

Modifications:
- extract code from set(InternalThreadLocalMap, V) so it can be called externally to determine if a new item was created

Result:
Less code duplication in FastThreadLocal#set.
Copy link
Copy Markdown
Member

@normanmaurer normanmaurer left a comment

Choose a reason for hiding this comment

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

Merge once green... LGTM!

Thanks buddy

@Scottmitch Scottmitch added this to the 4.0.55.Final milestone Dec 22, 2017
@Scottmitch Scottmitch merged commit ea73e47 into netty:4.1 Dec 22, 2017
@Scottmitch Scottmitch deleted the thread_local branch December 22, 2017 17:42
@Scottmitch
Copy link
Copy Markdown
Member Author

4.0 (f8a0eea)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants