changeset 5705:39d91e76c05c sr-v2

Simplify code.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 20 Feb 2024 09:51:20 +0100
parents a68e8eae7273
children 148abae1fcd0
files pkg/mesh/strtree.go
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/mesh/strtree.go	Mon Feb 19 18:27:40 2024 +0100
+++ b/pkg/mesh/strtree.go	Tue Feb 20 09:51:20 2024 +0100
@@ -262,18 +262,16 @@
 			return singleThreaded(top, depth)
 		}
 		var (
-			first = true
 			box   Box2D
 			done  = make(chan struct{})
 			n     = s.index[top+1]
-			count = int32(0)
+			count int32
 			mu    sync.Mutex
 		)
 		store := func(b Box2D) {
 			mu.Lock()
 			defer mu.Unlock()
-			if first {
-				first = false
+			if count == 0 {
 				box = b
 			} else {
 				box = box.Union(b)