Updated on 2026-08-14

This commit is contained in:
Tangem 2025-02-19 16:23:03 +03:00
parent 6f47e7d742
commit 6a5a8300cf
10 changed files with 116 additions and 18 deletions

View file

@ -64,4 +64,12 @@ inline fun <T> MutableList<T>.addOrReplace(item: T, predicate: (T) -> Boolean) {
if (!isReplaced) {
add(item)
}
}
fun <T> List<T>.filterIf(condition: Boolean, predicate: (T) -> Boolean): List<T> {
return if (condition) {
this.filter(predicate)
} else {
this
}
}