Skip to content

Commit

Permalink
Merge pull request #211 from kcalvinalvin/2024-11-07-dont-allocate-udata
Browse files Browse the repository at this point in the history
wire: don't allocate if udata count is 0
  • Loading branch information
kcalvinalvin authored Nov 7, 2024
2 parents a636c35 + ed75f60 commit a48cdc4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wire/udata.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ func (ud *UData) DeserializeCompact(r io.Reader) error {
if err != nil {
return err
}
if udCount == 0 {
return nil
}
ud.LeafDatas = make([]LeafData, udCount)

for i := range ud.LeafDatas {
Expand Down

0 comments on commit a48cdc4

Please sign in to comment.