From 80be3df73d70984aab25ac799022f29ef9daa171 Mon Sep 17 00:00:00 2001 From: Peter Stace Date: Thu, 5 Oct 2023 05:14:19 +1100 Subject: [PATCH] Optimise `LineString` `Envelope` method --- geom/type_line_string.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/geom/type_line_string.go b/geom/type_line_string.go index 43aebd1c..b23e71d4 100644 --- a/geom/type_line_string.go +++ b/geom/type_line_string.go @@ -213,12 +213,7 @@ func (s LineString) IsEmpty() bool { // Envelope returns the Envelope that most tightly surrounds the geometry. func (s LineString) Envelope() Envelope { - var env Envelope - n := s.seq.Length() - for i := 0; i < n; i++ { - env = env.uncheckedExtend(s.seq.GetXY(i)) - } - return env + return s.seq.Envelope() } // Boundary returns the spatial boundary of this LineString. For closed