XXX TBD: change all the scode primitives to be native and get rid of this slow path here.
(vec vector.Any)
| 38 | // XXX TBD: change all the scode primitives to be native and get rid of |
| 39 | // this slow path here. |
| 40 | func (p *ScodeEncoder) Write(vec vector.Any) { |
| 41 | if vec.Len() == 0 { |
| 42 | return |
| 43 | } |
| 44 | var b scode.Builder |
| 45 | for slot := range vec.Len() { |
| 46 | b.Reset() |
| 47 | vec.Serialize(&b, slot) |
| 48 | body := b.Bytes().Body() |
| 49 | p.update(body) |
| 50 | p.bytes = scode.Append(p.bytes, body) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | func (p *ScodeEncoder) WriteBytes(bytes scode.Bytes) { |
| 55 | p.update(bytes) |