forked from cerc-io/plugeth
p2p: initialize maps with known size (#27229)
This commit is contained in:
@@ -78,7 +78,7 @@ func (it *IPTracker) PredictEndpoint() string {
|
||||
it.gcStatements(it.clock.Now())
|
||||
|
||||
// The current strategy is simple: find the endpoint with most statements.
|
||||
counts := make(map[string]int)
|
||||
counts := make(map[string]int, len(it.statements))
|
||||
maxcount, max := 0, ""
|
||||
for _, s := range it.statements {
|
||||
c := counts[s.endpoint] + 1
|
||||
|
||||
Reference in New Issue
Block a user