Skip to content

Commit ed75f60

Browse files
committed
wire: don't allocate if udata count is 0
Done for equality so that reflect.DeepEqual() returns true. If we allocate then it's not equal.
1 parent a636c35 commit ed75f60

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

wire/udata.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ func (ud *UData) DeserializeCompact(r io.Reader) error {
247247
if err != nil {
248248
return err
249249
}
250+
if udCount == 0 {
251+
return nil
252+
}
250253
ud.LeafDatas = make([]LeafData, udCount)
251254

252255
for i := range ud.LeafDatas {

0 commit comments

Comments
 (0)