You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "pjfanning (via GitHub)" <gi...@apache.org> on 2023/06/16 08:27:30 UTC

[GitHub] [incubator-pekko] pjfanning commented on a diff in pull request #402: fix sign in code to generate a random signed short

pjfanning commented on code in PR #402:
URL: https://github.com/apache/incubator-pekko/pull/402#discussion_r1231948876


##########
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:
   thanks - sorted that now



-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org