From 07f6570470fa66349088cfdb0191e7a83489535a Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 15 Nov 2019 10:45:28 +0800 Subject: [PATCH] Remove unnecessary list creation --- .../net.mamoe.mirai/network/protocol/tim/TIMProtocol.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/TIMProtocol.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/TIMProtocol.kt index deeb94717..c8c765ed2 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/TIMProtocol.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/TIMProtocol.kt @@ -8,7 +8,6 @@ import net.mamoe.mirai.utils.solveIpAddress object TIMProtocol { val SERVER_IP: List = { //add("183.60.56.29") - val list = mutableListOf() arrayOf( "sz3.tencent.com", "sz4.tencent.com", @@ -17,9 +16,7 @@ object TIMProtocol { "sz8.tencent.com", "sz9.tencent.com", "sz2.tencent.com" - ).forEach { list.add(solveIpAddress(it)) } // 需 IPv4 地址 - - list.toList() + ).map { solveIpAddress(it) } // 需 IPv4 地址 }()//不使用lazy, 在初始化时就加载. val head = "02".hexToBytes()