From 93c6ac526aabb797f228691706293238e1d6d954 Mon Sep 17 00:00:00 2001 From: Andrew Pimenov Date: Sun, 9 Aug 2026 16:11:29 +0300 Subject: [PATCH] use zip for pairwise hop iteration in path_findings --- src/netsleuth/interpret.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/netsleuth/interpret.py b/src/netsleuth/interpret.py index 06e1441..c3fc2a0 100644 --- a/src/netsleuth/interpret.py +++ b/src/netsleuth/interpret.py @@ -127,8 +127,7 @@ def path_findings(trace: TraceResult) -> list[Finding]: # rate limiting on those routers, not a real problem, no matter how many hops # in a row stayed silent; only loss that persists all the way to the end is real. loss_persists_to_the_end = trace.hops[-1].loss_pct >= 20.0 - for index, hop in enumerate(trace.hops[:-1]): - following = trace.hops[index + 1] + for hop, following in zip(trace.hops, trace.hops[1:]): if loss_persists_to_the_end and hop.loss_pct >= 20.0 and following.loss_pct >= 20.0: findings.append( Finding(