From 9fdce175168d2bad35593f4966c87ca5cf41faa6 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 9 Feb 2023 03:16:09 +0100 Subject: [PATCH] fix(cec2020): correct gnx's index to prevent panic --- bench/cec2020/helperFunctions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bench/cec2020/helperFunctions.go b/bench/cec2020/helperFunctions.go index abb8410..2d17ead 100644 --- a/bench/cec2020/helperFunctions.go +++ b/bench/cec2020/helperFunctions.go @@ -153,7 +153,7 @@ func getGnx(p []float64, fnx float64) []float64 { gnxsum += gnx[i] } - gnx[len(p)] = fnx - gnxsum + gnx[len(p)-1] = fnx - gnxsum return gnx }