From 56f1c9a6f3e0f4724004e7adb690eb101628bea3 Mon Sep 17 00:00:00 2001 From: Him188 Date: Wed, 2 Oct 2019 20:55:17 +0800 Subject: [PATCH] Use String.repeat instead of SB --- .../net/mamoe/mirai/network/protocol/tim/packet/Packet.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mirai-core/src/main/java/net/mamoe/mirai/network/protocol/tim/packet/Packet.kt b/mirai-core/src/main/java/net/mamoe/mirai/network/protocol/tim/packet/Packet.kt index 1da431920..30128fcef 100644 --- a/mirai-core/src/main/java/net/mamoe/mirai/network/protocol/tim/packet/Packet.kt +++ b/mirai-core/src/main/java/net/mamoe/mirai/network/protocol/tim/packet/Packet.kt @@ -17,10 +17,6 @@ internal object PacketNameFormatter { return name } - return StringBuilder().apply { - repeat(longestNameLength - name.length) { - this.append(" ") - } - }.toString() + name + return " ".repeat(longestNameLength - name.length) + name } } \ No newline at end of file