(b *scode.Builder, slot uint32)
| 42 | } |
| 43 | |
| 44 | func (r *Record) Serialize(b *scode.Builder, slot uint32) { |
| 45 | b.BeginContainer() |
| 46 | if r.Typ.Opts != 0 { |
| 47 | // XXX TBD: improve performance of this in summit |
| 48 | var nones []int |
| 49 | var optOff int |
| 50 | for k := range r.Fields { |
| 51 | if r.Typ.Fields[k].Opt { |
| 52 | if isNone(r.Fields[k], slot) { |
| 53 | nones = append(nones, optOff) |
| 54 | optOff++ |
| 55 | continue |
| 56 | } |
| 57 | optOff++ |
| 58 | } |
| 59 | r.Fields[k].Serialize(b, uint32(slot)) |
| 60 | } |
| 61 | b.EndContainerWithNones(r.Typ.Opts, nones) |
| 62 | return |
| 63 | } |
| 64 | for _, f := range r.Fields { |
| 65 | f.Serialize(b, slot) |
| 66 | } |
| 67 | b.EndContainer() |
| 68 | } |
| 69 | |
| 70 | func buildTags(runlens []uint32, n uint32) ([]uint32, uint32) { |
| 71 | tags := make([]uint32, n) |
nothing calls this directly
no test coverage detected