Renamed firstOrNullIsInstance

This commit is contained in:
Valentin Kipyatkov
2014-11-21 15:22:53 +03:00
parent ddc60ac5dd
commit d334011d5d
6 changed files with 13 additions and 13 deletions
@@ -36,19 +36,19 @@ public fun <T: Any> T?.singletonOrEmptyList(): List<T> = if (this != null) Colle
public fun <T: Any> T?.singletonOrEmptySet(): Set<T> = if (this != null) Collections.singleton(this) else Collections.emptySet()
[suppress("NOTHING_TO_INLINE")]
public inline fun <reified T : Any> Stream<*>.firstOrNullIsInstance(): T? {
public inline fun <reified T : Any> Stream<*>.firstIsInstanceOrNull(): T? {
for (element in this) if (element is T) return element
return null
}
[suppress("NOTHING_TO_INLINE")]
public inline fun <reified T : Any> Iterable<*>.firstOrNullIsInstance(): T? {
public inline fun <reified T : Any> Iterable<*>.firstIsInstanceOrNull(): T? {
for (element in this) if (element is T) return element
return null
}
[suppress("NOTHING_TO_INLINE")]
public inline fun <reified T : Any> Array<*>.firstOrNullIsInstance(): T? {
public inline fun <reified T : Any> Array<*>.firstIsInstanceOrNull(): T? {
for (element in this) if (element is T) return element
return null
}