satellite/gc: Init map with an aprox size
Because the PieceTracker receives a piece count per nodes which is an approximation of the number of nodes that they are going to be reported by the metainfo loop so we can use as a good guess of the map's size and initialized with it. Change-Id: I644db40926c03e4c457457fb41d2ec1da059cea6
This commit is contained in:
parent
319d2cad11
commit
7eb3b2d6d0
@ -38,7 +38,7 @@ func NewPieceTracker(log *zap.Logger, config Config, pieceCounts map[storj.NodeI
|
||||
creationDate: time.Now().UTC(),
|
||||
pieceCounts: pieceCounts,
|
||||
|
||||
retainInfos: make(map[storj.NodeID]*RetainInfo),
|
||||
retainInfos: make(map[storj.NodeID]*RetainInfo, len(pieceCounts)),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user