remove Unused parameter 'sf' in calcTrendValue function (#6900)

Signed-off-by: fuling <fuling.lgz@alibaba-inc.com>
This commit is contained in:
李国忠 2020-03-03 16:23:27 +08:00 committed by GitHub
parent df92a00838
commit 2bf4952049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -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. // 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. // 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 "tf" is the trend factor.
// The argument "b" is the set of computed trend factors. // The argument "s0" is the computed smoothed value.
// The argument "d" is the set of raw input values. // The argument "s1" is the computed trend factor.
func calcTrendValue(i int, sf, tf, s0, s1, b float64) float64 { // The argument "b" is the raw input value.
func calcTrendValue(i int, tf, s0, s1, b float64) float64 {
if i == 0 { if i == 0 {
return b return b
} }
@ -249,7 +250,7 @@ func funcHoltWinters(vals []parser.Value, args parser.Expressions, enh *EvalNode
x = sf * samples.Points[i].V x = sf * samples.Points[i].V
// Scale the last smoothed value with the trend at this point. // 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) y = (1 - sf) * (s1 + b)
s0, s1 = s1, x+y s0, s1 = s1, x+y