nvollmar commented on code in PR #402:
URL: https://github.com/apache/incubator-pekko/pull/402#discussion_r1231865421
##########
actor/src/main/scala/org/apache/pekko/io/dns/IdGenerator.scala:
##########
@@ -30,7 +30,9 @@ private[pekko] trait IdGenerator {
*/
@InternalApi
private[pekko] object IdGenerator {
- private val MaxUnsignedShort = 65535
+ // Random.nextInt(bound) generates a random int in the range 0 (inclusive)
to bound (exclusive),
+ // so add 1 to Max Unsigned Short (65535)
+ private val SignedShortBound = 65536
Review Comment:
Wouldn't that be `UnsignedShortBound`?
I'd leave the constant as `MaxUnsignedShort = 65535` and then call
`rand.nextInt(UnsignedShortBound + 1)` and leave the comment there.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]