From cc8ede3772ad6a8f691d918da54b9bc44589a813 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 25 Feb 2023 13:20:57 +0100 Subject: [PATCH] stats: correct slices init --- p2/stats/stats.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p2/stats/stats.go b/p2/stats/stats.go index 57f83aa..8b1cd02 100644 --- a/p2/stats/stats.go +++ b/p2/stats/stats.go @@ -19,7 +19,7 @@ func Variance(f []float64) float64 { func Autocorrelate(f []float64, maxShift float64) []float64 { fLen := len(f) m := float64(fLen) * maxShift - v := make([]float64, int(m), int(m)*4) + v := make([]float64, 0, int(m)*4) currentShift := 0 for m >= float64(currentShift) { @@ -43,7 +43,7 @@ func Autocorrelate(f []float64, maxShift float64) []float64 { func AutocorrelateMP(f []float64, maxShift float64) []float64 { fLen := len(f) m := float64(fLen) * maxShift - v := make([]float64, int(m), 10) + v := make([]float64, 0, int(m)*4) currentShift := 0 for m >= float64(currentShift) {