mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
SortedArrayList.cloneToList() is no longer susseptible to ConcurrentModificationException
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 MiB |
@@ -158,11 +158,7 @@ class SortedArrayList<T: Comparable<T>>(initialSize: Int = 10) : MutableCollecti
|
|||||||
inline fun forEachIndexed(action: (Int, T) -> Unit) = arrayList.forEachIndexed(action)
|
inline fun forEachIndexed(action: (Int, T) -> Unit) = arrayList.forEachIndexed(action)
|
||||||
|
|
||||||
fun cloneToList(): List<T> {
|
fun cloneToList(): List<T> {
|
||||||
val ret = ArrayList<T>()
|
return arrayList.toList()
|
||||||
forEach {
|
|
||||||
ret.add(it)
|
|
||||||
}
|
|
||||||
return ret
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user