Skip to content

Commit

Permalink
Preallocate map in FastCommit
Browse files Browse the repository at this point in the history
  • Loading branch information
fxamacker committed Feb 28, 2024
1 parent 83d8870 commit 6825950
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ func (s *PersistentSlabStorage) FastCommit(numWorkers int) error {
// process the results while encoders are working
// we need to capture them inside a map
// again so we can apply them in order of keys
encSlabByID := make(map[SlabID][]byte)
encSlabByID := make(map[SlabID][]byte, len(keysWithOwners))
for i := 0; i < len(keysWithOwners); i++ {
result := <-results
// if any error return
Expand Down

0 comments on commit 6825950

Please sign in to comment.