From 32dc95a6e49d72991b6b6e783f20ca788a2913e5 Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 22 Feb 2020 13:48:40 +0800 Subject: [PATCH] Add `LockFreeLinkedList.iterator` --- .../kotlin/net.mamoe.mirai/utils/LockFreeLinkedList.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/LockFreeLinkedList.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/LockFreeLinkedList.kt index 0212d8a48..1acc1a462 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/LockFreeLinkedList.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/LockFreeLinkedList.kt @@ -68,6 +68,10 @@ fun LockFreeLinkedList.asSequence(): Sequence { } } +operator fun LockFreeLinkedList.iterator(): Iterator { + return asSequence().iterator() +} + /** * 构建链表结构然后转为 [LockFreeLinkedList] */