Style change of def starting with if
* When a def starts with if and is not a oneliner the if should be on a new line. * The reason is that it might be easy to miss the if when reading the code.
This commit is contained in:
parent
1557f0c75b
commit
5dc108567d
27 changed files with 271 additions and 244 deletions
|
|
@ -298,17 +298,18 @@ private[remote] object EndpointManager {
|
|||
endpoint
|
||||
}
|
||||
|
||||
def unregisterEndpoint(endpoint: ActorRef): Unit = if (isWritable(endpoint)) {
|
||||
val address = writableToAddress(endpoint)
|
||||
addressToWritable.get(address) match {
|
||||
case Some(policy) if policy.isTombstone ⇒ // There is already a tombstone directive, leave it there
|
||||
case _ ⇒ addressToWritable -= address
|
||||
def unregisterEndpoint(endpoint: ActorRef): Unit =
|
||||
if (isWritable(endpoint)) {
|
||||
val address = writableToAddress(endpoint)
|
||||
addressToWritable.get(address) match {
|
||||
case Some(policy) if policy.isTombstone ⇒ // There is already a tombstone directive, leave it there
|
||||
case _ ⇒ addressToWritable -= address
|
||||
}
|
||||
writableToAddress -= endpoint
|
||||
} else if (isReadOnly(endpoint)) {
|
||||
addressToReadonly -= readonlyToAddress(endpoint)
|
||||
readonlyToAddress -= endpoint
|
||||
}
|
||||
writableToAddress -= endpoint
|
||||
} else if (isReadOnly(endpoint)) {
|
||||
addressToReadonly -= readonlyToAddress(endpoint)
|
||||
readonlyToAddress -= endpoint
|
||||
}
|
||||
|
||||
def writableEndpointWithPolicyFor(address: Address): Option[EndpointPolicy] = addressToWritable.get(address)
|
||||
|
||||
|
|
@ -328,13 +329,14 @@ private[remote] object EndpointManager {
|
|||
case _ ⇒ false
|
||||
}
|
||||
|
||||
def markAsFailed(endpoint: ActorRef, timeOfRelease: Deadline): Unit = if (isWritable(endpoint)) {
|
||||
addressToWritable += writableToAddress(endpoint) -> Gated(timeOfRelease)
|
||||
writableToAddress -= endpoint
|
||||
} else if (isReadOnly(endpoint)) {
|
||||
addressToReadonly -= readonlyToAddress(endpoint)
|
||||
readonlyToAddress -= endpoint
|
||||
}
|
||||
def markAsFailed(endpoint: ActorRef, timeOfRelease: Deadline): Unit =
|
||||
if (isWritable(endpoint)) {
|
||||
addressToWritable += writableToAddress(endpoint) -> Gated(timeOfRelease)
|
||||
writableToAddress -= endpoint
|
||||
} else if (isReadOnly(endpoint)) {
|
||||
addressToReadonly -= readonlyToAddress(endpoint)
|
||||
readonlyToAddress -= endpoint
|
||||
}
|
||||
|
||||
def markAsQuarantined(address: Address, reason: Throwable): Unit = addressToWritable += address -> Quarantined(reason)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue