Skip to content

Commit f94b01e

Browse files
authored
Merge pull request #2654 from CortexFoundation/dev
rlp: add AppendRaw method to RawList
2 parents a8ae3ba + 44a0dc4 commit f94b01e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

rlp/raw.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ func (r *RawList[T]) Append(item T) error {
145145
return nil
146146
}
147147

148+
// AppendRaw adds an encoded item to the list.
149+
func (r *RawList[T]) AppendRaw(b []byte) {
150+
if r.enc == nil {
151+
r.enc = make([]byte, 9)
152+
}
153+
r.enc = append(r.enc, b...)
154+
}
155+
148156
// StringSize returns the encoded size of a string.
149157
func StringSize(s string) uint64 {
150158
switch n := len(s); n {

0 commit comments

Comments
 (0)