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

@ -68,7 +68,7 @@ class DirectByteBufferPoolBenchmark {
def unpooledHeapAllocAndRelease(): Unit = {
val idx = random.nextInt(unpooledHeapBuffers.length)
val oldBuf = unpooledHeapBuffers(idx)
if (oldBuf != null) DirectByteBufferPool.tryCleanDirectByteBuffer(oldBuf)
if (oldBuf ne null) DirectByteBufferPool.tryCleanDirectByteBuffer(oldBuf)
unpooledHeapBuffers(idx) = ByteBuffer.allocateDirect(size)
}
@ -76,7 +76,7 @@ class DirectByteBufferPoolBenchmark {
def unpooledDirectAllocAndRelease(): Unit = {
val idx = random.nextInt(unpooledDirectBuffers.length)
val oldBuf = unpooledDirectBuffers(idx)
if (oldBuf != null) DirectByteBufferPool.tryCleanDirectByteBuffer(oldBuf)
if (oldBuf ne null) DirectByteBufferPool.tryCleanDirectByteBuffer(oldBuf)
unpooledDirectBuffers(idx) = ByteBuffer.allocateDirect(size)
}
@ -84,7 +84,7 @@ class DirectByteBufferPoolBenchmark {
def pooledDirectAllocAndRelease(): Unit = {
val idx = random.nextInt(pooledDirectBuffers.length)
val oldBuf = pooledDirectBuffers(idx)
if (oldBuf != null) arteryPool.release(oldBuf)
if (oldBuf ne null) arteryPool.release(oldBuf)
pooledDirectBuffers(idx) = arteryPool.acquire()
}