Next returns the next element of the record and false if its present; otherwise, nil and true for None.
(opt bool)
| 70 | // Next returns the next element of the record and false if its |
| 71 | // present; otherwise, nil and true for None. |
| 72 | func (r *RecordIter) Next(opt bool) (Bytes, bool) { |
| 73 | if opt { |
| 74 | off := r.off |
| 75 | r.off++ |
| 76 | if TestBit(r.nones, off) { |
| 77 | return nil, true |
| 78 | } |
| 79 | } |
| 80 | return r.elems.Next(), false |
| 81 | } |
| 82 | |
| 83 | func TestBit(b []byte, off int) bool { |
| 84 | return b[off>>3]&(1<<(off&7)) != 0 |
no test coverage detected