mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2025-01-25 15:40:22 +01:00
unexport span methods
This commit is contained in:
parent
88e9088704
commit
1df81c3e1d
@ -37,7 +37,7 @@ func (c3d *Coverage3D) Insert(c Coord) {
|
|||||||
defer c3d.mu.Unlock()
|
defer c3d.mu.Unlock()
|
||||||
zr := c3d.zRanges[c.Z]
|
zr := c3d.zRanges[c.Z]
|
||||||
if zr == nil {
|
if zr == nil {
|
||||||
xr := c3d.pool.Alloc()
|
xr := c3d.pool.alloc()
|
||||||
xr.From = int32(c.X)
|
xr.From = int32(c.X)
|
||||||
xr.To = int32(c.X)
|
xr.To = int32(c.X)
|
||||||
xr.Next = nil
|
xr.Next = nil
|
||||||
|
@ -26,7 +26,7 @@ func newSpanPool() *spanPool {
|
|||||||
return &spanPool{}
|
return &spanPool{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sp *spanPool) Alloc() *span {
|
func (sp *spanPool) alloc() *span {
|
||||||
if sp.freeList != nil {
|
if sp.freeList != nil {
|
||||||
next := sp.freeList
|
next := sp.freeList
|
||||||
sp.freeList = next.Next
|
sp.freeList = next.Next
|
||||||
@ -66,7 +66,7 @@ func (sp *spanPool) insert(s *span, pos, value int32) *span {
|
|||||||
|
|
||||||
// No head -> create.
|
// No head -> create.
|
||||||
if s == nil {
|
if s == nil {
|
||||||
s = sp.Alloc()
|
s = sp.alloc()
|
||||||
s.From = pos
|
s.From = pos
|
||||||
s.To = pos
|
s.To = pos
|
||||||
s.Value = value
|
s.Value = value
|
||||||
@ -81,7 +81,7 @@ func (sp *spanPool) insert(s *span, pos, value int32) *span {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
// Disjunct -> create new head.
|
// Disjunct -> create new head.
|
||||||
prev := sp.Alloc()
|
prev := sp.alloc()
|
||||||
prev.From = pos
|
prev.From = pos
|
||||||
prev.To = pos
|
prev.To = pos
|
||||||
prev.Value = value
|
prev.Value = value
|
||||||
@ -109,7 +109,7 @@ func (sp *spanPool) insert(s *span, pos, value int32) *span {
|
|||||||
}
|
}
|
||||||
// Before next -> New between current and next
|
// Before next -> New between current and next
|
||||||
if next == nil || pos < next.From {
|
if next == nil || pos < next.From {
|
||||||
sn := sp.Alloc()
|
sn := sp.alloc()
|
||||||
sn.From = pos
|
sn.From = pos
|
||||||
sn.To = pos
|
sn.To = pos
|
||||||
sn.Value = value
|
sn.Value = value
|
||||||
|
Loading…
Reference in New Issue
Block a user