add minimum map size to Blocker

This commit is contained in:
Dan Laine 2020-06-16 15:34:34 -04:00
parent 8fdeef5eb6
commit 191cd48593
1 changed files with 5 additions and 1 deletions

View File

@ -10,12 +10,16 @@ import (
"github.com/ava-labs/gecko/ids"
)
const (
minBlockerSize = 16
)
// Blocker tracks objects that are blocked
type Blocker map[[32]byte][]Blockable
func (b *Blocker) init() {
if *b == nil {
*b = make(map[[32]byte][]Blockable)
*b = make(map[[32]byte][]Blockable, minBlockerSize)
}
}