From 2bf49520492a7806a7462354dc92f49ebda92402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=9B=BD=E5=BF=A0?= Date: Tue, 3 Mar 2020 16:23:27 +0800 Subject: [PATCH] remove Unused parameter 'sf' in calcTrendValue function (#6900) Signed-off-by: fuling --- promql/functions.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/promql/functions.go b/promql/functions.go index 47ea26b3c..367c965a5 100644 --- a/promql/functions.go +++ b/promql/functions.go @@ -193,10 +193,11 @@ func instantValue(vals []parser.Value, out Vector, isRate bool) Vector { // Calculate the trend value at the given index i in raw data d. // This is somewhat analogous to the slope of the trend at the given index. -// The argument "s" is the set of computed smoothed values. -// The argument "b" is the set of computed trend factors. -// The argument "d" is the set of raw input values. -func calcTrendValue(i int, sf, tf, s0, s1, b float64) float64 { +// The argument "tf" is the trend factor. +// The argument "s0" is the computed smoothed value. +// The argument "s1" is the computed trend factor. +// The argument "b" is the raw input value. +func calcTrendValue(i int, tf, s0, s1, b float64) float64 { if i == 0 { return b } @@ -249,7 +250,7 @@ func funcHoltWinters(vals []parser.Value, args parser.Expressions, enh *EvalNode x = sf * samples.Points[i].V // Scale the last smoothed value with the trend at this point. - b = calcTrendValue(i-1, sf, tf, s0, s1, b) + b = calcTrendValue(i-1, tf, s0, s1, b) y = (1 - sf) * (s1 + b) s0, s1 = s1, x+y