Skip to content

Commit

Permalink
Fix missing if-else
Browse files Browse the repository at this point in the history
This PR adds a missing if-else.
  • Loading branch information
sterlingdeng committed Nov 12, 2024
1 parent 82bca40 commit 33c0388
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/gcc/kalman.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ func (k *kalman) updateEstimate(measurement time.Duration) time.Duration {
root3 := 3 * root
if zms > root3 {
k.measurementUncertainty = math.Max(alpha*k.measurementUncertainty+(1-alpha)*root3*root3, 1)
} else {
k.measurementUncertainty = math.Max(alpha*k.measurementUncertainty+(1-alpha)*zms*zms, 1)
}
k.measurementUncertainty = math.Max(alpha*k.measurementUncertainty+(1-alpha)*zms*zms, 1)
}

estimateUncertainty := k.estimateError + k.processUncertainty
Expand Down

0 comments on commit 33c0388

Please sign in to comment.