This commit is contained in:
Will Charczuk 2017-04-24 23:00:28 -07:00
parent 64d2ef25c7
commit 685186cc4d
2 changed files with 4 additions and 4 deletions

View file

@ -49,9 +49,9 @@ func (lrs LinearRegressionSeries) GetLimit() int {
// GetEndIndex returns the effective limit end.
func (lrs LinearRegressionSeries) GetEndIndex() int {
offset := lrs.GetOffset() + lrs.Len()
windowEnd := lrs.GetOffset() + lrs.GetLimit()
innerSeriesLastIndex := lrs.InnerSeries.Len() - 1
return Math.MinInt(offset, innerSeriesLastIndex)
return Math.MinInt(windowEnd, innerSeriesLastIndex)
}
// GetOffset returns the data offset.

View file

@ -52,9 +52,9 @@ func (prs PolynomialRegressionSeries) GetLimit() int {
// GetEndIndex returns the effective limit end.
func (prs PolynomialRegressionSeries) GetEndIndex() int {
offset := prs.GetOffset() + prs.Len()
windowEnd := prs.GetOffset() + prs.GetLimit()
innerSeriesLastIndex := prs.InnerSeries.Len() - 1
return Math.MinInt(offset, innerSeriesLastIndex)
return Math.MinInt(windowEnd, innerSeriesLastIndex)
}
// GetOffset returns the data offset.