[
https://issues.apache.org/jira/browse/HTTPCORE-535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16548883#comment-16548883
]
ASF GitHub Bot commented on HTTPCORE-535:
-----------------------------------------
Github user xiaohu-zhang closed the pull request at:
https://github.com/apache/httpcomponents-core/pull/69
> mod workerCount is power of two can be improved as &(workerCount-1)
> --------------------------------------------------------------------
>
> Key: HTTPCORE-535
> URL: https://issues.apache.org/jira/browse/HTTPCORE-535
> Project: HttpComponents HttpCore
> Issue Type: Improvement
> Components: HttpCore NIO
> Reporter: silver9886
> Priority: Critical
> Fix For: 5.0-beta3
>
>
> if workerCount is power of two . improve
> final int i = Math.abs(currentWorker.incrementAndGet() % workerCount);
> to be
> final int i = Math.abs(currentWorker.incrementAndGet() & (workerCount-1) );
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]