diff options
author | Vincent Legoll <vincent.legoll@gmail.com> | 2020-03-20 22:44:50 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-03-20 15:53:50 -0600 |
commit | 86c6ec280c38df9a68a2061eed2ec659e0a0f7c7 (patch) | |
tree | c6ee4b4bab421a7a909a4db10f6776a820bb4600 | |
parent | f4f8ef7cdea138cfaa2f3ca0ee31fa23d3bcf1cc (diff) | |
download | blktrace-86c6ec280c38df9a68a2061eed2ec659e0a0f7c7.tar.gz |
btt_plot.py: Use sum() instead of open-coding it to compute list average
Signed-off-by: Vincent Legoll <vincent.legoll@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rwxr-xr-x | btt/btt_plot.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/btt/btt_plot.py b/btt/btt_plot.py index 76fcca8..9c6f207 100755 --- a/btt/btt_plot.py +++ b/btt/btt_plot.py @@ -125,10 +125,7 @@ def get_data(files): def _avg(vals): """Computes average for array of values passed""" - total = 0.0 - for val in vals: - total += val - return total / len(vals) + return sum(vals) / len(vals) #------------------------------------------------------ if len(xs) < 1000: |