From 86c6ec280c38df9a68a2061eed2ec659e0a0f7c7 Mon Sep 17 00:00:00 2001 From: Vincent Legoll Date: Fri, 20 Mar 2020 22:44:50 +0100 Subject: [PATCH] btt_plot.py: Use sum() instead of open-coding it to compute list average Signed-off-by: Vincent Legoll Signed-off-by: Jens Axboe --- btt/btt_plot.py | 5 +---- 1 file changed, 1 insertion(+), 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: -- 2.25.1