optimize _unix_annotations dedup with dict.fromkeys

This commit is contained in:
Andrew Pimenov 2026-08-09 16:09:05 +03:00
parent f59f860327
commit 85da4aab1f

View file

@ -47,11 +47,7 @@ def _unix_probes(body: str) -> list[float | None]:
def _unix_annotations(body: str) -> list[str]:
seen: list[str] = []
for token in ANNOTATION_RE.findall(body):
if token not in seen:
seen.append(token)
return seen
return list(dict.fromkeys(ANNOTATION_RE.findall(body)))
def parse_linux(text: str) -> list[TraceHop]: