Skip to content

Commit f28a47f

Browse files
committed
Adding some more checks for None.
1 parent 1ee28d8 commit f28a47f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

misc/analyze_cache.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ def pluck(name: str, chunks: Iterable[JsonDict]) -> Iterable[JsonDict]:
7777

7878

7979
def report_counter(counter: Counter[str], amount: int | None = None) -> None:
80+
if amount is None:
81+
amount=len(counter) #default to the length of the counter if `amount` is None
8082
for name, count in counter.most_common(amount):
8183
print(f" {count: <8} {name}")
8284
print()

0 commit comments

Comments
 (0)