p2: return nil slice on err

This commit is contained in:
leo 2023-02-26 18:01:31 +01:00
parent 129f33c9a6
commit 67a9d55311
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

@ -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