From 376bb840e7f00434682bfe4ce6d06f63577c45db Mon Sep 17 00:00:00 2001 From: "kayos@tcp.direct" Date: Tue, 9 Jul 2024 05:24:39 -0700 Subject: [PATCH] Fix (pogreb): initialize slice as zero len to avoid empty keys --- pogreb/pogreb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pogreb/pogreb.go b/pogreb/pogreb.go index 9e9ed53..7d9db2f 100644 --- a/pogreb/pogreb.go +++ b/pogreb/pogreb.go @@ -23,7 +23,7 @@ func (pstore *Store) Len() int { func (pstore *Store) Keys() [][]byte { iter := pstore.DB.Items() - ks := make([][]byte, pstore.DB.Count()) + ks := make([][]byte, 0, pstore.DB.Count()) for k, _, _ := iter.Next(); k != nil; k, _, _ = iter.Next() { ks = append(ks, k) }