Skip to content

Commit

Permalink
Fix (pogreb): initialize slice as zero len to avoid empty keys
Browse files Browse the repository at this point in the history
  • Loading branch information
yunginnanet committed Jul 9, 2024
1 parent 76d1dfb commit 376bb84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pogreb/pogreb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 376bb84

Please sign in to comment.