Minor, remove unnecessary NOTHING_TO_INLINE suppressions
This commit is contained in:
@@ -35,37 +35,31 @@ 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()
|
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<*>.firstIsInstanceOrNull(): T? {
|
public inline fun <reified T : Any> Stream<*>.firstIsInstanceOrNull(): T? {
|
||||||
for (element in this) if (element is T) return element
|
for (element in this) if (element is T) return element
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
[suppress("NOTHING_TO_INLINE")]
|
|
||||||
public inline fun <reified T : Any> Iterable<*>.firstIsInstanceOrNull(): T? {
|
public inline fun <reified T : Any> Iterable<*>.firstIsInstanceOrNull(): T? {
|
||||||
for (element in this) if (element is T) return element
|
for (element in this) if (element is T) return element
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
[suppress("NOTHING_TO_INLINE")]
|
|
||||||
public inline fun <reified T : Any> Array<*>.firstIsInstanceOrNull(): T? {
|
public inline fun <reified T : Any> Array<*>.firstIsInstanceOrNull(): T? {
|
||||||
for (element in this) if (element is T) return element
|
for (element in this) if (element is T) return element
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
[suppress("NOTHING_TO_INLINE")]
|
|
||||||
public inline fun <reified T> Stream<*>.firstIsInstance(): T {
|
public inline fun <reified T> Stream<*>.firstIsInstance(): T {
|
||||||
for (element in this) if (element is T) return element
|
for (element in this) if (element is T) return element
|
||||||
throw NoSuchElementException("No element of given type found")
|
throw NoSuchElementException("No element of given type found")
|
||||||
}
|
}
|
||||||
|
|
||||||
[suppress("NOTHING_TO_INLINE")]
|
|
||||||
public inline fun <reified T> Iterable<*>.firstIsInstance(): T {
|
public inline fun <reified T> Iterable<*>.firstIsInstance(): T {
|
||||||
for (element in this) if (element is T) return element
|
for (element in this) if (element is T) return element
|
||||||
throw NoSuchElementException("No element of given type found")
|
throw NoSuchElementException("No element of given type found")
|
||||||
}
|
}
|
||||||
|
|
||||||
[suppress("NOTHING_TO_INLINE")]
|
|
||||||
public inline fun <reified T> Array<*>.firstIsInstance(): T {
|
public inline fun <reified T> Array<*>.firstIsInstance(): T {
|
||||||
for (element in this) if (element is T) return element
|
for (element in this) if (element is T) return element
|
||||||
throw NoSuchElementException("No element of given type found")
|
throw NoSuchElementException("No element of given type found")
|
||||||
|
|||||||
@@ -178,7 +178,6 @@ public class DescriptorKindFilter(
|
|||||||
.filterNotNull()
|
.filterNotNull()
|
||||||
.toReadOnlyList()
|
.toReadOnlyList()
|
||||||
|
|
||||||
[suppress("NOTHING_TO_INLINE")]
|
|
||||||
private inline fun <reified T> staticFields() = javaClass<T>().getFields().filter { Modifier.isStatic(it.getModifiers()) }
|
private inline fun <reified T> staticFields() = javaClass<T>().getFields().filter { Modifier.isStatic(it.getModifiers()) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user