Improvement: prealloc capacity for to avoid realloc

This commit is contained in:
nk_ysg 2025-07-30 08:09:42 +08:00
parent a56558d092
commit 57344573d8
No known key found for this signature in database
GPG key ID: CA76B171FA60C7F0

View file

@ -82,7 +82,7 @@ func showAttributeCounts(ns nodeSet) {
} }
} }
var keys []string keys := make([]string, 0, len(attrcount))
var maxlength int var maxlength int
for key := range attrcount { for key := range attrcount {
keys = append(keys, key) keys = append(keys, key)