Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 440358a

Browse files
committed
fix: use iterator to iterate clients in MultiLogSenderHandler
1 parent 6a9acbf commit 440358a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/src/main/java/com/itsaky/androidide/services/log/MultiLogSenderHandler.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ class MultiLogSenderHandler(consumer: ((LogLine) -> Unit)? = null) :
4343
set(value) {
4444
field = value
4545
lock.withLock {
46-
for (i in clients.indices) {
47-
clients[i].consumer = value
48-
}
46+
clients.forEach { it?.consumer = value }
4947
}
5048
}
5149

@@ -91,9 +89,7 @@ class MultiLogSenderHandler(consumer: ((LogLine) -> Unit)? = null) :
9189
override fun close() {
9290
this.keepAlive.set(false)
9391
lock.withLock {
94-
for (i in clients.indices) {
95-
clients[i].closeAndLogError()
96-
}
92+
clients.forEach { it?.closeAndLogError() }
9793
}
9894
}
9995

0 commit comments

Comments
 (0)