projects
/
blktrace.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4f8ef7
)
btt_plot.py: Use sum() instead of open-coding it to compute list average
author
Vincent Legoll
<vincent.legoll@gmail.com>
Fri, 20 Mar 2020 21:44:50 +0000
(22:44 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Fri, 20 Mar 2020 21:53:50 +0000
(15:53 -0600)
Signed-off-by: Vincent Legoll <vincent.legoll@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
btt/btt_plot.py
patch
|
blob
|
blame
|
history
diff --git
a/btt/btt_plot.py
b/btt/btt_plot.py
index 76fcca853bc07aaa4cf96dd1b4fcf174beefd34b..9c6f207318559dc41b665f11984cfc93b2adc86e 100755
(executable)
--- 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: