fixed avg not returning correctly

This commit is contained in:
2021-10-31 17:16:56 +01:00
parent 978232dd0a
commit c3ab1aa2f6

View File

@@ -82,12 +82,12 @@ func (s *Sprays) Avg() (avg [][]float32) {
total int
)
total++
for _, sp := range s.Sprays {
for i, r2p := range sp.Spray {
if i == 0 {
continue
}
total++
if len(avg) <= i-1 {
avg = append(avg, r2p)
} else {