From f402451812ed7a4583773b9f1170c27bdf13695a Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 7 Dec 2019 15:57:07 +0800 Subject: [PATCH] Make checker inline --- mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/TEA.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/TEA.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/TEA.kt index 822ce3d0e..de07bfbb2 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/TEA.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/TEA.kt @@ -358,7 +358,8 @@ private object TEA { } } -private fun ByteArray.checkDataLengthAndReturnSelf(length: Int = this.size): ByteArray { +@Suppress("NOTHING_TO_INLINE") +private inline fun ByteArray.checkDataLengthAndReturnSelf(length: Int = this.size): ByteArray { require(length % 8 == 0 && length >= 16) { "data must len % 8 == 0 && len >= 16 but given (length=$length) ${this.toUHexString()}" } return this } \ No newline at end of file