Skip to content

Commit

Permalink
Merge pull request #6569 from rusttech/master
Browse files Browse the repository at this point in the history
fix: fix slice init length
  • Loading branch information
zhangchiqing authored Oct 23, 2024
2 parents b80055f + 090c057 commit 36f067d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/util/cmd/read-badger/cmd/find-block-by-commits/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func FindBlockIDByCommits(

func toStateCommitments(commitsStr string) ([]flow.StateCommitment, error) {
commitSlice := strings.Split(commitsStr, ",")
commits := make([]flow.StateCommitment, len(commitSlice))
commits := make([]flow.StateCommitment, 0, len(commitSlice))
for _, c := range commitSlice {
commit, err := toStateCommitment(c)
if err != nil {
Expand Down

0 comments on commit 36f067d

Please sign in to comment.