Updated on 2026-08-14
This commit is contained in:
parent
d43e4fb40e
commit
db1299b6af
17 changed files with 386 additions and 272 deletions
|
|
@ -28,4 +28,8 @@ fun <T> MutableList<T>.replaceBy(item: T, predicate: (T) -> Boolean): Boolean {
|
|||
|
||||
fun <T> MutableList<T>.replaceByOrAdd(item: T, predicate: (T) -> Boolean) {
|
||||
if (!replaceBy(item, predicate)) add(item)
|
||||
}
|
||||
|
||||
fun <T> MutableList<T>.copy(): MutableList<T> {
|
||||
return this.map { it }.toMutableList()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue