From 84664a9a69da17821eb75d423e1db8ace0e5b046 Mon Sep 17 00:00:00 2001 From: yujr Date: Wed, 27 Jul 2022 10:25:09 +0800 Subject: [PATCH] =?UTF-8?q?@yujr=20@0001=20@=E4=BF=AE=E6=94=B9=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=90=8D=E4=B8=8D=E5=90=88=E7=90=86=EF=BC=8CHashMap?= =?UTF-8?q?=E6=9C=AA=E8=AE=BE=E7=BD=AE=E5=88=9D=E5=A7=8B=E5=8C=96=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/hutool/core/img/BackgroundRemoval.java | 5 +++-- hutool-core/src/main/java/cn/hutool/core/net/NetUtil.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hutool-core/src/main/java/cn/hutool/core/img/BackgroundRemoval.java b/hutool-core/src/main/java/cn/hutool/core/img/BackgroundRemoval.java index 92c43f666..a29dc645e 100755 --- a/hutool-core/src/main/java/cn/hutool/core/img/BackgroundRemoval.java +++ b/hutool-core/src/main/java/cn/hutool/core/img/BackgroundRemoval.java @@ -299,7 +299,8 @@ public class BackgroundRemoval { } } - Map map = new HashMap<>(list.size()); + int initialCapacity = (int) ((float) list.size() / 0.75F + 1.0F); + Map 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; } -} \ No newline at end of file +} diff --git a/hutool-core/src/main/java/cn/hutool/core/net/NetUtil.java b/hutool-core/src/main/java/cn/hutool/core/net/NetUtil.java index 1877191fb..c05b64fbf 100755 --- a/hutool-core/src/main/java/cn/hutool/core/net/NetUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/net/NetUtil.java @@ -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) {