clarify the nextInt/nextLong boundaries (thanks oOo)

This commit is contained in:
jrandom
2004-08-29 22:42:21 +00:00
committed by zzz
parent 53c7ff14df
commit 07ef3582f7
4 changed files with 7 additions and 9 deletions

View File

@ -67,7 +67,7 @@ class DataPublisherJob extends JobImpl {
// if there's nothing we *need* to send, only send 10% of the time
if (explicit.size() <= 0) {
if (getContext().random().nextInt(9) <= 8)
if (getContext().random().nextInt(10) > 0)
return toSend;
}

View File

@ -71,7 +71,7 @@ class TunnelPoolManagerJob extends JobImpl {
built = true;
} else {
// 10% chance of building a new tunnel
if (getContext().random().nextInt(9) > 0) {
if (getContext().random().nextInt(10) > 0) {
// all good, no need for more inbound tunnels
if (_log.shouldLog(Log.DEBUG))
_log.debug("Sufficient inbound tunnels (" + curFreeInboundTunnels + ")");
@ -93,7 +93,7 @@ class TunnelPoolManagerJob extends JobImpl {
built = true;
} else {
// 10% chance of building a new tunnel
if (getContext().random().nextInt(9) > 0) {
if (getContext().random().nextInt(10) > 0) {
// all good, no need for more outbound tunnels
if (_log.shouldLog(Log.DEBUG))
_log.debug("Sufficient outbound tunnels (" + curOutboundTunnels + ")");