Skip to content

Commit

Permalink
B910 Use Counter() instead of defaultdict(int) to avoid excessive mem…
Browse files Browse the repository at this point in the history
  • Loading branch information
rustydb committed Nov 12, 2024
1 parent 848aa44 commit a396cb8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions canu/report/network/firmware/firmware.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License
#
# (C) Copyright 2022-2023 Hewlett Packard Enterprise Development LP
# (C) Copyright 2022-2024 Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
Expand All @@ -20,7 +20,7 @@
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
"""CANU commands that report the firmware of the entire Shasta network."""
from collections import defaultdict
from collections import Counter
import datetime
import ipaddress
import json
Expand Down Expand Up @@ -353,8 +353,8 @@ def summary_table(data, out="-"):
click.echo("\nSummary", file=out)
click.echo(dash, file=out)

firmware_versions = defaultdict(int)
network_summary = defaultdict(int)
firmware_versions = Counter()
network_summary = Counter()
for firmware in data:
network_summary[firmware[1]] += 1

Expand Down

0 comments on commit a396cb8

Please sign in to comment.