ValueAt returns the value in vec at slot. If b is not nil, ValueAt calls b's Truncate method and builds the value in it. To safely reuse b while the value is live, call b's Reset method or the value's Copy method.
(b *scode.Builder, vec Any, slot uint32)
| 16 | // Truncate method and builds the value in it. To safely reuse b while the |
| 17 | // value is live, call b's Reset method or the value's Copy method. |
| 18 | func ValueAt(b *scode.Builder, vec Any, slot uint32) super.Value { |
| 19 | var typ super.Type |
| 20 | if d, ok := vec.(*Dynamic); ok { |
| 21 | typ = d.TypeOf(slot) |
| 22 | } else { |
| 23 | typ = vec.Type() |
| 24 | } |
| 25 | if b == nil { |
| 26 | b = scode.NewBuilder() |
| 27 | } else { |
| 28 | b.Truncate() |
| 29 | } |
| 30 | vec.Serialize(b, slot) |
| 31 | return super.NewValue(typ, b.Bytes().Body()) |
| 32 | } |
no test coverage detected