From 67a9d55311d0984a5b1fc257d66e88d098de3752 Mon Sep 17 00:00:00 2001 From: leo Date: Sun, 26 Feb 2023 18:01:31 +0100 Subject: [PATCH] p2: return nil slice on err --- p2/stats/stats.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2/stats/stats.go b/p2/stats/stats.go index 149576b..67ce6a3 100644 --- a/p2/stats/stats.go +++ b/p2/stats/stats.go @@ -66,7 +66,7 @@ func AutocorrelateMP(f []float64, maxShift float64) []float64 { func MutCorrelate(f1, f2 []float64, maxShift float64) ([]float64, error) { fLen := len(f1) if fLen != len(f2) { - return []float64{}, errors.New("arrays passed are of different lengths") + return nil, errors.New("arrays passed are of different lengths") } m := float64(fLen) * maxShift