summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/timeseries/timeseries.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/timeseries/timeseries.go b/internal/timeseries/timeseries.go
index 685f0e7..dc5225b 100644
--- a/internal/timeseries/timeseries.go
+++ b/internal/timeseries/timeseries.go
@@ -403,9 +403,9 @@ func (ts *timeSeries) extract(l *tsLevel, start, finish time.Time, num int, resu
// Where should scanning start?
if dstStart.After(srcStart) {
- advance := dstStart.Sub(srcStart) / srcInterval
- srcIndex += int(advance)
- srcStart = srcStart.Add(advance * srcInterval)
+ advance := int(dstStart.Sub(srcStart) / srcInterval)
+ srcIndex += advance
+ srcStart = srcStart.Add(time.Duration(advance) * srcInterval)
}
// The i'th value is computed as show below.