Explorar o código

Simpler constructor

Richard Crowley %!s(int64=10) %!d(string=hai) anos
pai
achega
49469ac48f
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      sample.go

+ 1 - 1
sample.go

@@ -55,7 +55,7 @@ func NewExpDecaySample(reservoirSize int, alpha float64) Sample {
 		t0:            time.Now(),
 		values:        newExpDecaySampleHeap(reservoirSize),
 	}
-	s.t1 = time.Now().Add(rescaleThreshold)
+	s.t1 = s.t0.Add(rescaleThreshold)
 	return s
 }