Skip to content

Commit

Permalink
Remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlovsky committed Mar 10, 2023
1 parent 93fc365 commit 9307a1d
Showing 1 changed file with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,3 @@ def aggregate_responses_for_infohash(infohash: bytes, responses: List[TrackerRes
if health.infohash == infohash and health > result:
result = health
return result


def aggregate_health_by_infohash(health_list: List[HealthInfo]) -> List[HealthInfo]:
"""
For each infohash in the health list, finds the "best" health info (with the max number of seeders)
"""
d: Dict[bytes, HealthInfo] = {}
for health in health_list:
infohash = health.infohash
if infohash not in d or health.seeders > d[infohash].seeders:
d[infohash] = health
return list(d.values())

0 comments on commit 9307a1d

Please sign in to comment.