Preallocate (safe) slices when we know the size (#10459)

This commit is contained in:
Klaus Post authored and GitHub committed 2020-09-14 20:44:18 -07:00
1 parent b1c99e88ac
commit 34859c6d4b
7 files changed
+42 -46

No files matched your search

+1 -1
View File
@@ -47,7 +47,7 @@ func (s *peerRESTServer) GetLocksHandler(w http.ResponseWriter, r *http.Request)
ctx := newContext(r, w, "GetLocks")
var llockers []map[string][]lockRequesterInfo
llockers := make([]map[string][]lockRequesterInfo, 0, len(globalLockServers))
for _, llocker := range globalLockServers {
llockers = append(llockers, llocker.DupLockMap())
}