Adjust visibility

This commit is contained in:
Him188 2020-03-28 23:55:05 +08:00
parent 5672837878
commit c854be95a7

View File

@ -18,8 +18,7 @@ import kotlin.jvm.JvmName
/** /**
* 要求 [this] 最小为 [min]. * 要求 [this] 最小为 [min].
*/ */
@Suppress("NOTHING_TO_INLINE") internal fun Int.coerceAtLeastOrFail(min: Int): Int {
inline fun Int.coerceAtLeastOrFail(min: Int): Int {
require(this >= min) require(this >= min)
return this return this
} }
@ -27,8 +26,7 @@ inline fun Int.coerceAtLeastOrFail(min: Int): Int {
/** /**
* 要求 [this] 最小为 [min]. * 要求 [this] 最小为 [min].
*/ */
@Suppress("NOTHING_TO_INLINE") internal fun Long.coerceAtLeastOrFail(min: Long): Long {
inline fun Long.coerceAtLeastOrFail(min: Long): Long {
require(this >= min) require(this >= min)
return this return this
} }
@ -36,12 +34,10 @@ inline fun Long.coerceAtLeastOrFail(min: Long): Long {
/** /**
* 要求 [this] 最大为 [max]. * 要求 [this] 最大为 [max].
*/ */
@Suppress("NOTHING_TO_INLINE") internal fun Int.coerceAtMostOrFail(max: Int): Int =
inline fun Int.coerceAtMostOrFail(max: Int): Int =
if (this >= max) error("value is greater than its expected maximum value $max") if (this >= max) error("value is greater than its expected maximum value $max")
else this else this
@Suppress("NOTHING_TO_INLINE") internal fun Long.coerceAtMostOrFail(max: Long): Long =
inline fun Long.coerceAtMostOrFail(max: Long): Long =
if (this >= max) error("value is greater than its expected maximum value $max") if (this >= max) error("value is greater than its expected maximum value $max")
else this else this