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:
Ivan Fraixedes 2020-11-27 10:44:19 +01:00
parent 319d2cad11
commit 7eb3b2d6d0
No known key found for this signature in database
GPG Key ID: 042B474597F96DB7

View File

@ -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)),
}
}