Skip to content

Commit

Permalink
minor clean-up2
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Kozlov authored and Boris Kozlov committed Jul 31, 2023
1 parent 772655e commit 87599c8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions module/mempool/herocache/backdata/heropool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ func (p *Pool) initFreeEntities() {
//
// If the pool has no available slots and an ejection is set, ejection occurs when adding a new entity.
// If an ejection occurred, ejectedEntity holds the ejected entity.

func (p *Pool) Add(entityId flow.Identifier, entity flow.Entity, owner uint64) (
entityIndex EIndex, slotAvailable bool, ejectedEntity flow.Entity) {
entityIndex, slotAvailable, ejectedEntity = p.sliceIndexForEntity()
Expand Down Expand Up @@ -209,7 +208,6 @@ func (p Pool) Size() uint32 {
// getHeads returns entities corresponding to the used and free heads.
func (p *Pool) getHeads() (*poolEntity, *poolEntity) {
var usedHead, freeHead *poolEntity

if p.used.size != 0 {
usedHead = &p.poolEntities[p.used.head]
}
Expand All @@ -227,6 +225,7 @@ func (p *Pool) getTails() (*poolEntity, *poolEntity) {
if p.used.size != 0 {
usedTail = &p.poolEntities[p.used.tail]
}

if p.free.size != 0 {
freeTail = &p.poolEntities[p.free.tail]
}
Expand Down

0 comments on commit 87599c8

Please sign in to comment.