Skip to content

Commit b35f8db

Browse files
sterlingdengmengelbart
authored andcommitted
Fix missing if-else
This PR adds a missing if-else.
1 parent 1553b7d commit b35f8db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/gcc/kalman.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ func (k *kalman) updateEstimate(measurement time.Duration) time.Duration {
8080
root3 := 3 * root
8181
if zms > root3 {
8282
k.measurementUncertainty = math.Max(alpha*k.measurementUncertainty+(1-alpha)*root3*root3, 1)
83+
} else {
84+
k.measurementUncertainty = math.Max(alpha*k.measurementUncertainty+(1-alpha)*zms*zms, 1)
8385
}
84-
k.measurementUncertainty = math.Max(alpha*k.measurementUncertainty+(1-alpha)*zms*zms, 1)
8586
}
8687

8788
estimateUncertainty := k.estimateError + k.processUncertainty

0 commit comments

Comments
 (0)