From 052120675fac2ace91dc2c01e5f63c3e6ec62f04 Mon Sep 17 00:00:00 2001 From: Emily Chen <82122323+fayfaychan@users.noreply.github.com> Date: Thu, 31 Mar 2022 12:32:32 -0400 Subject: [PATCH] Passing capacity to make() in place of length. (#1276) * Passing capacity to make() in place of length. The second argument is length and not capacity. --- trace/lrumap.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trace/lrumap.go b/trace/lrumap.go index 908c2497e..80095a5f6 100644 --- a/trace/lrumap.go +++ b/trace/lrumap.go @@ -44,7 +44,7 @@ func (lm lruMap) len() int { } func (lm lruMap) keys() []interface{} { - keys := make([]interface{}, len(lm.cacheKeys)) + keys := make([]interface{}, 0, len(lm.cacheKeys)) for k := range lm.cacheKeys { keys = append(keys, k) }