From 6d2d6bec35fa1c727090bee2d389316f4175b85a Mon Sep 17 00:00:00 2001 From: Him188 Date: Wed, 29 Jan 2020 21:59:55 +0800 Subject: [PATCH] Enhance printTLVMap --- .../kotlin/net.mamoe.mirai/utils/io/InputUtils.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io/InputUtils.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io/InputUtils.kt index 2c598eead..3bd8002ae 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io/InputUtils.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io/InputUtils.kt @@ -186,9 +186,9 @@ fun Input.readFlatTUVarIntMap(expectingEOF: Boolean = false, tagSize: Int = 1): fun Map.printTLVMap(name: String = "", keyLength: Int = 2) = debugPrintln("TLVMap $name= " + this.mapValues { (_, value) -> value.toUHexString() }.mapKeys { when (keyLength) { - 1 -> it.key.toUByte().toUHexString() - 2 -> it.key.toUShort().toUHexString() - 4 -> it.key.toUInt().toUHexString() + 1 -> it.key.toUByte().contentToString() + 2 -> it.key.toUShort().contentToString() + 4 -> it.key.toUInt().contentToString() else -> illegalArgument("Expecting 1, 2 or 4 for keyLength") } }.entries.joinToString(prefix = "{", postfix = "}", separator = "\n"))