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


##########
actor/src/main/scala/org/apache/pekko/io/dns/IdGenerator.scala:
##########
@@ -54,7 +56,6 @@ private[pekko] object IdGenerator {
   /**
    * @return a random sequence of ids for production
    */
-  def random(rand: java.util.Random): IdGenerator = new IdGenerator {
-    override def nextId(): Short = rand.nextInt(Short.MaxValue).toShort
-  }
+  def random(rand: java.util.Random): IdGenerator =
+    () => (rand.nextInt(MaxUnsignedShort) - Short.MinValue).toShort

Review Comment:
   good point @brharrington - I'll create a new PR



-- 
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]

Reply via email to