Make computation of indexed JavaTypeQualifiers eager

This commit is contained in:
Denis Zharkov
2015-07-02 12:53:48 +03:00
parent c01c59d562
commit 1469a0aa6f
2 changed files with 10 additions and 5 deletions
@@ -106,4 +106,5 @@ public fun <T> Collection<T>.toReadOnlyList(): List<T> =
public fun <T: Any> T?.singletonOrEmptyList(): List<T> = if (this != null) Collections.singletonList(this) else Collections.emptyList()
public inline fun <T> List<T>.getOrDefault(index: Int, default: (Int) -> T): T = if (index in 0..size() - 1) this[index] else default(index)
public inline fun <T> List<T>.getOrDefault(index: Int, default: (Int) -> T): T = if (index in 0..size() - 1) this[index] else default(index)
public inline fun <T> Array<T>.getOrDefault(index: Int, default: (Int) -> T): T = if (index in 0..size() - 1) this[index] else default(index)