optimization append (#7798)

This commit is contained in:
胡俊 2022-03-03 15:03:33 +08:00 committed by GitHub
parent f8e83e4a12
commit 3dddb75fed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,7 +130,7 @@ public class InternetAddressUtil {
serverAddrArr[1] = str.substring((str.indexOf(IPV6_END_MARK) + 2)); serverAddrArr[1] = str.substring((str.indexOf(IPV6_END_MARK) + 2));
} }
} else { } else {
serverAddrArr = str.split(":"); serverAddrArr = str.split(IP_PORT_SPLITER);
} }
return serverAddrArr; return serverAddrArr;
} }
@ -177,7 +177,7 @@ public class InternetAddressUtil {
if (InternetAddressUtil.isIP(ip)) { if (InternetAddressUtil.isIP(ip)) {
continue; continue;
} }
illegalResponse.append(ip + ","); illegalResponse.append(ip).append(",");
} }
if (illegalResponse.length() == 0) { if (illegalResponse.length() == 0) {