unexport span methods

This commit is contained in:
Sascha L. Teichmann 2024-01-07 03:44:45 +01:00
parent 88e9088704
commit 1df81c3e1d
2 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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