Function
writeCollectionBegin
(length int, typeName string, e *Encoder)
Source from the content-addressed store, hash-verified
| 114 | } |
| 115 | |
| 116 | func writeCollectionBegin(length int, typeName string, e *Encoder) error { |
| 117 | var err error |
| 118 | if length <= int(LIST_DIRECT_MAX) { |
| 119 | e.Append([]byte{BC_LIST_DIRECT + byte(length)}) |
| 120 | err = e.Encode(typeName) |
| 121 | if err != nil { |
| 122 | return err |
| 123 | } |
| 124 | } else { |
| 125 | e.Append([]byte{BC_LIST_FIXED}) |
| 126 | err = e.Encode(typeName) |
| 127 | if err != nil { |
| 128 | return err |
| 129 | } |
| 130 | err = e.Encode(int32(length)) |
| 131 | if err != nil { |
| 132 | return nil |
| 133 | } |
| 134 | } |
| 135 | return nil |
| 136 | } |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…