Compute MaxVendor and MaxVendorIdLI at encoding if not explicitly set

This commit is contained in:
Thomas LAY
2021-02-18 10:10:02 +01:00
parent d6069d62fa
commit e60298c839
3 changed files with 29 additions and 1 deletions
+7
View File
@@ -43,6 +43,13 @@ func (d *DisclosedVendors) Encode() string {
}
bitSize += entriesSize
} else {
if d.MaxVendorId == 0 {
for id, _ := range d.DisclosedVendors {
if id > d.MaxVendorId {
d.MaxVendorId = id
}
}
}
bitSize += d.MaxVendorId
}