Staticcheck (#464)
Using `go get -u honnef.co/go/tools/cmd/staticcheck` Uneaarthed a couple of real bugs
This commit is contained in:
@@ -147,7 +147,6 @@ func TestNack(t *testing.T) {
|
||||
func TestNewBuffer(t *testing.T) {
|
||||
type args struct {
|
||||
options Options
|
||||
ssrc uint32
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
@@ -136,7 +136,7 @@ func (n *nack) getNack(now time.Time, rtt uint32) (shouldSend bool, shouldRemove
|
||||
var requiredInterval time.Duration
|
||||
if n.tries > 0 {
|
||||
// exponentially backoff retries, but cap maximum spacing between retries
|
||||
requiredInterval := maxInterval
|
||||
requiredInterval = maxInterval
|
||||
backoffInterval := time.Duration(float64(rtt)*math.Pow(backoffFactor, float64(n.tries-1))) * time.Millisecond
|
||||
if backoffInterval < requiredInterval {
|
||||
requiredInterval = backoffInterval
|
||||
|
||||
Reference in New Issue
Block a user