simplify code (#234)

* simplify code, format makefile

* simplify code
master
Kevin Wan 4 years ago committed by GitHub
parent e5c560e8ba
commit 4b5c2de376
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -74,7 +74,10 @@ func (rw *RollingWindow) span() int {
func (rw *RollingWindow) updateOffset() {
span := rw.span()
if span > 0 {
if span <= 0 {
return
}
offset := rw.offset
start := offset + 1
steps := start + span
@ -95,7 +98,6 @@ func (rw *RollingWindow) updateOffset() {
rw.offset = (offset + span) % rw.size
rw.lastTime = timex.Now()
}
}
type Bucket struct {
Sum float64

Loading…
Cancel
Save