changeset 1188:f7131eeb2a53

Merged
author Sascha Wilde <wilde@intevation.de>
date Thu, 15 Nov 2018 19:06:53 +0100
parents 6b3001f51c2c (current diff) ba0d8c327b0b (diff)
children 3d50f558870c
files
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/octree/contours.go	Thu Nov 15 19:06:12 2018 +0100
+++ b/pkg/octree/contours.go	Thu Nov 15 19:06:53 2018 +0100
@@ -27,7 +27,7 @@
 	cond *sync.Cond
 }
 
-func NewContorResult(height float64) *ContourResult {
+func NewContourResult(height float64) *ContourResult {
 	cr := ContourResult{Height: height}
 	cr.cond = sync.NewCond(&cr.mu)
 	return &cr
@@ -57,9 +57,10 @@
 
 func DoContours(tree *Tree, heights []float64, store func(*ContourResult)) {
 
-	var contours []*ContourResult
-	for i := 0; i < len(heights); i++ {
-		contours = append(contours, NewContorResult(heights[i]))
+	contours := make([]*ContourResult, len(heights))
+
+	for i, h := range heights {
+		contours[i] = NewContourResult(h)
 	}
 
 	jobs := make(chan *ContourResult)