Skip to content

Commit 02de79b

Browse files
committed
Fix variable name collision
1 parent 06859d9 commit 02de79b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

defs/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ func (s *Server) PingAndJitter(count int) (float64, float64, error) {
171171
}
172172

173173
var lastPing, jitter float64
174-
for idx, ping := range pings {
174+
for idx, p := range pings {
175175
if idx != 0 {
176-
instJitter := math.Abs(lastPing - ping)
176+
instJitter := math.Abs(lastPing - p)
177177
if idx > 1 {
178178
if jitter > instJitter {
179179
jitter = jitter*0.7 + instJitter*0.3
@@ -182,7 +182,7 @@ func (s *Server) PingAndJitter(count int) (float64, float64, error) {
182182
}
183183
}
184184
}
185-
lastPing = ping
185+
lastPing = p
186186
}
187187

188188
return getAvg(pings), jitter, nil

0 commit comments

Comments
 (0)