Updated on 2026-08-14

This commit is contained in:
Tangem 2021-07-05 12:06:46 +03:00
parent 7308d79262
commit 9ddd3e883c
2 changed files with 9 additions and 2 deletions

View file

@ -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()
}