(struct: StructLayout, r: Reader)
| 4811 | |
| 4812 | // A positional shape is the presence mask over layout field order. |
| 4813 | function positionalRunShape(struct: StructLayout, r: Reader): Array<RunSlot> { |
| 4814 | const mask = r.uvarint() |
| 4815 | const fields = struct.fields |
| 4816 | const fieldBits = mask & ~RUN_EXTRA_BIT |
| 4817 | if (mask > RUN_EXTRA_BIT * 2 - 1 || (fieldBits >>> fields.length) !== 0) { |
| 4818 | invalid("a known row shape", undefined, r.options) |
| 4819 | } |
| 4820 | const shape: Array<RunSlot> = [] |
| 4821 | if ((mask & RUN_EXTRA_BIT) !== 0) shape.push(null) |
| 4822 | for (let i = 0; i < fields.length; i++) { |
| 4823 | if ((fieldBits & (1 << i)) !== 0) shape.push(fields[i]) |
| 4824 | } |
| 4825 | return shape |
| 4826 | } |
| 4827 | |
| 4828 | function decodeRunRow( |
| 4829 | plan: RunPlan, |
no test coverage detected