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/15 22:59:08 UTC
[GitHub] [incubator-pekko] pjfanning commented on a diff in pull request #401: support negative short ids in async DNS resolver code
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: 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