Explorar el Código

Simpler constructor

Richard Crowley hace 10 años
padre
commit
49469ac48f
Se han modificado 1 ficheros con 1 adiciones y 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
 }