From: Vincent Legoll Date: Fri, 20 Mar 2020 21:44:50 +0000 (+0100) Subject: btt_plot.py: Use sum() instead of open-coding it to compute list average X-Git-Tag: blktrace-1.3.0~20 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=86c6ec280c38df9a68a2061eed2ec659e0a0f7c7;p=blktrace.git btt_plot.py: Use sum() instead of open-coding it to compute list average Signed-off-by: Vincent Legoll Signed-off-by: Jens Axboe --- 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: