Merge pull request #29619 from YikSanChan/fix/replace-to-with-toSet

Replace to with toSet
This commit is contained in:
Patrik Nordwall 2020-09-23 09:56:19 +02:00 committed by GitHub
commit 1b026ec3d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,7 +195,7 @@ private[cluster] class Reachability private (
}
def remove(nodes: Iterable[UniqueAddress]): Reachability = {
val nodesSet = nodes.to(immutable.HashSet)
val nodesSet: Set[UniqueAddress] = nodes.toSet
val newRecords = records.filterNot(r => nodesSet(r.observer) || nodesSet(r.subject))
val newVersions = versions -- nodes
Reachability(newRecords, newVersions)