Load special java methods as properites
Currently only those that override special builtin properties (e.g. `Collection.size`) Their modality is defined by method's modality
This commit is contained in:
@@ -105,3 +105,11 @@ public fun String.lastIndexOfOrNull(char: Char, startIndex: Int = 0, ignoreCase:
|
||||
val index = lastIndexOf(char, startIndex, ignoreCase)
|
||||
return if (index >= 0) index else null
|
||||
}
|
||||
|
||||
inline fun <T, R : Any> Iterable<T>.firstNotNullResult(transform: (T) -> R?): R? {
|
||||
for (element in this) {
|
||||
val result = transform(element)
|
||||
if (result != null) return result
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user