mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-14 16:18:13 +00:00
Merge pull request #109 from HaoZiMc/main
fix[net]: TaskBus计算hash的时候,在taskExecutorHash达到int最大值的时候,计算出来是负数
This commit is contained in:
1 file changed
+1
-1
@@ -95,7 +95,7 @@ public final class TaskBus {
|
|||||||
|
|
||||||
private static int calTaskExecutorIndex(int taskExecutorHash) {
|
private static int calTaskExecutorIndex(int taskExecutorHash) {
|
||||||
// Other hash algorithms can be customized to make the distribution more uniform
|
// Other hash algorithms can be customized to make the distribution more uniform
|
||||||
return Math.abs(taskExecutorHash) % EXECUTOR_SIZE;
|
return Math.abs(taskExecutorHash % EXECUTOR_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int calTaskExecutorHash(Object argument) {
|
public static int calTaskExecutorHash(Object argument) {
|
||||||
|
|||||||
Reference in new issue
Block a user