Updated on 2026-08-14
This commit is contained in:
parent
7308d79262
commit
9ddd3e883c
2 changed files with 9 additions and 2 deletions
|
|
@ -8,4 +8,10 @@ fun <T> List<T>.containsAny(list: List<T>): Boolean {
|
|||
list.forEach { if (it == mainItem) return true }
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
fun <T> MutableList<T>.removeBy(predicate: (T) -> Boolean): Boolean {
|
||||
val toRemove = this.filter(predicate)
|
||||
this.removeAll(toRemove)
|
||||
return toRemove.isNotEmpty()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue