Skip to content

Commit fc8b246

Browse files
committed
rlp: move ListSize to raw.go
1 parent 24bb68e commit fc8b246

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

rlp/encode.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ type Encoder interface {
4545
EncodeRLP(io.Writer) error
4646
}
4747

48-
// ListSize returns the encoded size of an RLP list with the given
49-
// content size.
50-
func ListSize(contentSize uint64) uint64 {
51-
return uint64(headsize(contentSize)) + contentSize
52-
}
53-
5448
// Encode writes the RLP encoding of val to w. Note that Encode may
5549
// perform many small writes in some cases. Consider making w
5650
// buffered.

rlp/raw.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ type RawValue []byte
2828

2929
var rawValueType = reflect.TypeOf(RawValue{})
3030

31+
// ListSize returns the encoded size of an RLP list with the given
32+
// content size.
33+
func ListSize(contentSize uint64) uint64 {
34+
return uint64(headsize(contentSize)) + contentSize
35+
}
36+
3137
// Split returns the content of first RLP value and any
3238
// bytes after the value as subslices of b.
3339
func Split(b []byte) (k Kind, content, rest []byte, err error) {

0 commit comments

Comments
 (0)