mirror of
https://github.com/Horizontal42/netsleuth.git
synced 2026-11-10 15:42:10 +03:00
optimize first_loss_jump with zip pairwise iteration
This commit is contained in:
parent
93c6ac526a
commit
6810c0f753
1 changed files with 1 additions and 2 deletions
|
|
@ -153,8 +153,7 @@ def badge(severity: str, emoji: bool, lang: str = "en") -> str:
|
|||
|
||||
|
||||
def first_loss_jump(hops: list[dict]) -> int | None:
|
||||
for index, hop in enumerate(hops[:-1]):
|
||||
following = hops[index + 1]
|
||||
for hop, following in zip(hops, hops[1:]):
|
||||
if hop.get("loss_pct", 0.0) >= _LOSS_JUMP_PCT and following.get("loss_pct", 0.0) >= _LOSS_JUMP_PCT:
|
||||
return hop.get("ttl")
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue