Updated on 2026-08-14
This commit is contained in:
parent
0b8efe6d02
commit
125b301a32
3 changed files with 74 additions and 17 deletions
|
|
@ -18,4 +18,9 @@ fun <T> Collection<T>.isSingleItem(): Boolean = this.size == 1
|
|||
*/
|
||||
fun <T> Collection<T>.copy(): Collection<T> {
|
||||
return this.map { it }
|
||||
}
|
||||
|
||||
inline fun <T> List<T>.indexOfFirstOrNull(predicate: (T) -> Boolean): Int? {
|
||||
val index = indexOfFirst(predicate)
|
||||
return if (index == -1) null else index
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue