From f1b3c1c90fcbad28bbdf451acd12583cf1a9c5a3 Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 17 Jun 2022 22:14:56 +0200 Subject: [PATCH] go(randomSearch): properly size the vals slice --- algo/randomSearch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algo/randomSearch.go b/algo/randomSearch.go index 9c7095e..96480d3 100644 --- a/algo/randomSearch.go +++ b/algo/randomSearch.go @@ -48,7 +48,7 @@ func genValsRandomSearch(dimens uint, vals []float64, uniform *distuv.Uniform) { // which is relevant to the objective function. // nolint func singleRandomSearch(dimens uint, f string, min, max float64) ([]float64, float64) { - var vals []float64 + vals := make([]float64, dimens) var res float64