You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/05/16 10:29:04 UTC
[GitHub] [rocketmq] yiwuxia opened a new issue #1212:
NettyRemotingClient.java's line 144 why mod 999 twice?
yiwuxia opened a new issue #1212: NettyRemotingClient.java's line 144 why mod 999 twice?
URL: https://github.com/apache/rocketmq/issues/1212
the code is follow:
```
private static int initValueIndex() {
Random r = new Random();
return Math.abs(r.nextInt() % 999) % 999;
}
```
the result Math.abs(r.nextInt() % 999) is always equal Math.abs(r.nextInt() % 999) % 999?
so why do you write this code ? necessary?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services