=clu replace Set -- with diff and ++ with union

* better performance according to
  https://docs.google.com/presentation/d/1Qjryxoe-fYEM8ZPhM-98LKfbhnRcn5eAEMNlVVnixsA/pub
This commit is contained in:
Patrik Nordwall 2015-10-30 14:59:36 +01:00
parent 9380983d3c
commit c7c187f6b7
24 changed files with 46 additions and 46 deletions

View file

@ -41,7 +41,7 @@ class RemoteInitErrorSpec extends FlatSpec with Matchers {
}
""").resolve()
def currentThreadIds() = {
def currentThreadIds(): Set[Long] = {
val threads = Thread.getAllStackTraces().keySet()
threads.collect({ case t: Thread if (!t.isDaemon()) t.getId() })
}
@ -56,7 +56,7 @@ class RemoteInitErrorSpec extends FlatSpec with Matchers {
eventually(timeout(30 seconds), interval(800 milliseconds)) {
val current = currentThreadIds()
// no new threads should remain compared to the start state
(current -- start) should be(empty)
(current diff start) should be(empty)
}
}
}

View file

@ -74,8 +74,8 @@ object Configuration {
}
val engine = NettySSLSupport.initializeClientSSL(settings, NoLogging).getEngine
val gotAllSupported = enabled.toSet -- engine.getSupportedCipherSuites.toSet
val gotAllEnabled = enabled.toSet -- engine.getEnabledCipherSuites.toSet
val gotAllSupported = enabled.toSet diff engine.getSupportedCipherSuites.toSet
val gotAllEnabled = enabled.toSet diff engine.getEnabledCipherSuites.toSet
gotAllSupported.isEmpty || (throw new IllegalArgumentException("Cipher Suite not supported: " + gotAllSupported))
gotAllEnabled.isEmpty || (throw new IllegalArgumentException("Cipher Suite not enabled: " + gotAllEnabled))
engine.getSupportedProtocols.contains(settings.SSLProtocol.get) ||