From 4e60c96e981a00c112ed4d9ce862bbac7723f63e Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Tue, 7 Jan 2025 17:49:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8D=A2=E7=94=A8=20node=20=E9=81=8D=E5=8E=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ghostchu/btn/sparkle/module/analyse/AnalyseService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/ghostchu/btn/sparkle/module/analyse/AnalyseService.java b/src/main/java/com/ghostchu/btn/sparkle/module/analyse/AnalyseService.java index 97cf012..c1ff38e 100644 --- a/src/main/java/com/ghostchu/btn/sparkle/module/analyse/AnalyseService.java +++ b/src/main/java/com/ghostchu/btn/sparkle/module/analyse/AnalyseService.java @@ -588,13 +588,14 @@ public DualIPv4v6Tries filterIP(DualIPv4v6Tries ips) { public DualIPv4v6AssociativeTries filterIP(DualIPv4v6AssociativeTries ips) { DualIPv4v6AssociativeTries dualIPv4v6Tries = new DualIPv4v6AssociativeTries<>(); - ips.forEach(ip -> { + ips.nodeIterator(false).forEachRemaining(node -> { + var ip = node.getKey(); if (!ip.isLocal() && !ip.isLoopback()) { try { if (ip.getPrefixLength() == null && ip.isIPv6()) { ip = ip.toPrefixBlock(ipv6ConvertToPrefixLength); } - dualIPv4v6Tries.put(ip, ips.get(ip)); + dualIPv4v6Tries.put(ip, node.getValue()); } catch (Exception e) { log.error("Unable to convert {} with prefix block {}.", ip, ipv6ConvertToPrefixLength, e); }