Light Classes: Generate light wrappers for annotation entries

This commit is contained in:
Alexey Sedunov
2016-03-01 20:01:44 +03:00
parent 4debf0cc45
commit fefa0baeee
19 changed files with 202 additions and 61 deletions
@@ -80,3 +80,10 @@ fun <T> Collection<T>.toReadOnlyList(): List<T> =
fun <T: Any> T?.singletonOrEmptyList(): List<T> =
if (this != null) listOf(this) else emptyList()
fun <T> List<T>.indexOfFirst(startFrom: Int, predicate: (T) -> Boolean): Int {
for (index in startFrom..lastIndex) {
if (predicate(this[index])) return index
}
return -1
}