changeset 4704:9eb708176b43

STRTree: more efficent usage of slicing in collecting triangles during clipping.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 16 Oct 2019 18:22:33 +0200
parents 6e179b338f1a
children 901a74d866ac
files pkg/octree/strtree.go
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/octree/strtree.go	Wed Oct 16 18:03:24 2019 +0200
+++ b/pkg/octree/strtree.go	Wed Oct 16 18:22:33 2019 +0200
@@ -331,8 +331,9 @@
 			stack = append(stack, s.index[top+2:top+2+n]...)
 		} else { // leaf
 			top = -top - 1
-			for i, n := int32(0), s.index[top+1]; i < n; i++ {
-				tris[s.index[top+2+i]] = struct{}{}
+			n := s.index[top+1]
+			for _, idx := range s.index[top+2 : top+2+n] {
+				tris[idx] = struct{}{}
 			}
 		}
 	}