Improve performance

This commit is contained in:
Him188 2020-02-06 11:12:29 +08:00
parent 0671fd9abd
commit e53dcfd26b

View File

@ -197,9 +197,9 @@ open class LockFreeLinkedList<E> {
inline fun forEach(block: (E) -> Unit) { inline fun forEach(block: (E) -> Unit) {
var node: Node<E> = head var node: Node<E> = head
while (true) { while (true) {
if (node === tail) return
node.letValueIfValid(block) node.letValueIfValid(block)
node = node.nextNode node = node.nextNode
if (node === tail) return
} }
} }