Skip to content

Commit

Permalink
Use a generator to avoid a needless list allocation (#1567)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek authored Apr 15, 2022
1 parent 0f99673 commit 83bb5f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion psutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2075,7 +2075,7 @@ def disk_io_counters(perdisk=False, nowrap=True):
rawdict[disk] = nt(*fields)
return rawdict
else:
return nt(*[sum(x) for x in zip(*rawdict.values())])
return nt(*(sum(x) for x in zip(*rawdict.values())))


disk_io_counters.cache_clear = functools.partial(
Expand Down

0 comments on commit 83bb5f8

Please sign in to comment.