reuse freeNodes
parent
c3f9992f18
commit
4eecb7fb94
|
@ -328,10 +328,11 @@ func (self *DeltaCoordsCache) getBunch(bunchId int64) (*coordsBunch, error) {
|
||||||
elem := self.lruList.PushFront(bunchId)
|
elem := self.lruList.PushFront(bunchId)
|
||||||
select {
|
select {
|
||||||
case nodes = <-freeNodes:
|
case nodes = <-freeNodes:
|
||||||
|
nodes = nodes[:0]
|
||||||
default:
|
default:
|
||||||
nodes = make([]element.Node, 0, self.bunchSize)
|
nodes = make([]element.Node, 0, self.bunchSize)
|
||||||
}
|
}
|
||||||
bunch = &coordsBunch{id: bunchId, coords: nil, elem: elem}
|
bunch = &coordsBunch{id: bunchId, coords: nodes, elem: elem}
|
||||||
needsGet = true
|
needsGet = true
|
||||||
self.table[bunchId] = bunch
|
self.table[bunchId] = bunch
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue