Make use of eq and ne. (#1994)

* chore: make use of eq instead of ==

* chore: make use of ne instead of !=
This commit is contained in:
He-Pin(kerr) 2025-08-03 17:32:32 +08:00 committed by GitHub
parent 19788583ee
commit 7325c729ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
84 changed files with 158 additions and 158 deletions

View file

@ -742,7 +742,7 @@ trait TestKitBase {
var elem: AnyRef = queue.peekFirst()
var left = leftNow
while (left.toNanos > 0 && elem == null) {
while (left.toNanos > 0 && (elem eq null)) {
// Use of (left / 2) gives geometric series limited by finish time similar to (1/2)^n limited by 1,
// so it is very precise
Thread.sleep(pollInterval.toMillis min (left / 2).toMillis)

View file

@ -47,7 +47,7 @@ class EventFilter(clazz: Class[_], system: ActorSystem) {
def intercept[T](code: Supplier[T]): T = {
val filter: pekko.testkit.EventFilter =
if (_clazz eq classOf[Logging.Error]) {
if (exceptionType == null) exceptionType = Logging.noCause.getClass
if (exceptionType eq null) exceptionType = Logging.noCause.getClass
new ErrorFilter(exceptionType, source, message, pattern, complete, occurrences)
} else if (_clazz eq classOf[Logging.Warning]) {
new WarningFilter(source, message, pattern, complete, occurrences)