Merge pull request #2485 from yujr1990/v5-dev

建议修改方法名,HashMap未设置初始化大小值,建议设置
This commit is contained in:
Golden Looly 2022-07-29 21:46:49 +08:00 committed by GitHub
commit 2e4c81bd01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -299,7 +299,8 @@ public class BackgroundRemoval {
}
}
Map<String, Integer> map = new HashMap<>(list.size());
int initialCapacity = (int) ((float) list.size() / 0.75F + 1.0F);
Map<String, Integer> map = new HashMap<>(initialCapacity);
for (String string : list) {
Integer integer = map.get(string);
if (integer == null) {

View File

@ -90,7 +90,7 @@ public class NetUtil {
* @return 大整数, 如发生异常返回 null
* @since 5.5.7
*/
public static BigInteger ipv6ToBitInteger(String IPv6Str) {
public static BigInteger ipv6ToBigInteger(String IPv6Str) {
try {
InetAddress address = InetAddress.getByName(IPv6Str);
if (address instanceof Inet6Address) {