@0001
@修改方法名不合理,HashMap未设置初始化大小值
This commit is contained in:
yujr 2022-07-27 10:25:09 +08:00
parent 630ed4775f
commit 84664a9a69
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) {
@ -351,4 +352,4 @@ public class BackgroundRemoval {
}
return false;
}
}
}

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) {