Skip to content

Commit 1637eba

Browse files
JakeWhartonqwwdfsad
authored andcommitted
Use Array.fill extension from stdlib
1 parent 955c735 commit 1637eba

File tree

4 files changed

+1
-31
lines changed

4 files changed

+1
-31
lines changed

kotlinx-coroutines-core/common/src/internal/ThreadSafeHeap.common.kt renamed to kotlinx-coroutines-core/common/src/internal/ThreadSafeHeap.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public open class ThreadSafeHeap<T> : SynchronizedObject() where T: ThreadSafeHe
3333
public val isEmpty: Boolean get() = size == 0
3434

3535
public fun clear() = synchronized(this) {
36-
a?.let { clear(it) }
36+
a?.fill(null)
3737
_size.value = 0
3838
}
3939

@@ -157,5 +157,3 @@ public open class ThreadSafeHeap<T> : SynchronizedObject() where T: ThreadSafeHe
157157
nj.index = j
158158
}
159159
}
160-
161-
internal expect fun <T> clear(a: Array<T?>)

kotlinx-coroutines-core/js/src/internal/ThreadSafeHeap.kt

Lines changed: 0 additions & 10 deletions
This file was deleted.

kotlinx-coroutines-core/jvm/src/internal/ThreadSafeHeap.kt

Lines changed: 0 additions & 8 deletions
This file was deleted.

kotlinx-coroutines-core/native/src/internal/ThreadSafeHeap.kt

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)