From 1df81c3e1d9a23514c1baa71e84deb62ad3f233b Mon Sep 17 00:00:00 2001 From: "Sascha L. Teichmann" Date: Sun, 7 Jan 2024 03:44:45 +0100 Subject: [PATCH] unexport span methods --- common/coverage.go | 2 +- common/spans.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/coverage.go b/common/coverage.go index 602ceed..6cbe1b9 100644 --- a/common/coverage.go +++ b/common/coverage.go @@ -37,7 +37,7 @@ func (c3d *Coverage3D) Insert(c Coord) { defer c3d.mu.Unlock() zr := c3d.zRanges[c.Z] if zr == nil { - xr := c3d.pool.Alloc() + xr := c3d.pool.alloc() xr.From = int32(c.X) xr.To = int32(c.X) xr.Next = nil diff --git a/common/spans.go b/common/spans.go index 76d5528..4a48a90 100644 --- a/common/spans.go +++ b/common/spans.go @@ -26,7 +26,7 @@ func newSpanPool() *spanPool { return &spanPool{} } -func (sp *spanPool) Alloc() *span { +func (sp *spanPool) alloc() *span { if sp.freeList != nil { next := sp.freeList sp.freeList = next.Next @@ -66,7 +66,7 @@ func (sp *spanPool) insert(s *span, pos, value int32) *span { // No head -> create. if s == nil { - s = sp.Alloc() + s = sp.alloc() s.From = pos s.To = pos s.Value = value @@ -81,7 +81,7 @@ func (sp *spanPool) insert(s *span, pos, value int32) *span { return s } // Disjunct -> create new head. - prev := sp.Alloc() + prev := sp.alloc() prev.From = pos prev.To = pos prev.Value = value @@ -109,7 +109,7 @@ func (sp *spanPool) insert(s *span, pos, value int32) *span { } // Before next -> New between current and next if next == nil || pos < next.From { - sn := sp.Alloc() + sn := sp.alloc() sn.From = pos sn.To = pos sn.Value = value