Skip to content

Commit a4df632

Browse files
authored
fix: preallocate struct before appending to it (#123)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent e5a7e01 commit a4df632

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tuna.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type TunaV1State struct {
3333
}
3434

3535
func (t *TunaV1State) MarshalCBOR() ([]byte, error) {
36-
var tmpInterlink []any
36+
tmpInterlink := []any{}
3737
for _, item := range t.Interlink {
3838
tmpInterlink = append(tmpInterlink, item)
3939
}

0 commit comments

Comments
 (0)