mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +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)
|
||||
|
||||
fun cloneToList(): List<T> {
|
||||
val ret = ArrayList<T>()
|
||||
forEach {
|
||||
ret.add(it)
|
||||
}
|
||||
return ret
|
||||
return arrayList.toList()
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user