mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 07:37:20 +00:00
Most uses of the iterator are like this:
it, _ := rlp.NewListIterator(data)
for it.Next() {
do(it.Value())
}
This doesn't require the iterator to be a pointer and it's better to
have it stack-allocated. AFAIK the compiler cannot prove it is OK to
stack-allocate when it is returned as a pointer because the methods of
`Iterator` use pointer receiver and also mutate the object.
The iterator type was not exported until very recently, so I think it is
still OK to change this API.
|
||
|---|---|---|
| .. | ||
| internal/rlpstruct | ||
| rlpgen | ||
| decode.go | ||
| decode_tail_test.go | ||
| decode_test.go | ||
| doc.go | ||
| encbuffer.go | ||
| encbuffer_example_test.go | ||
| encode.go | ||
| encode_test.go | ||
| encoder_example_test.go | ||
| iterator.go | ||
| iterator_test.go | ||
| raw.go | ||
| raw_test.go | ||
| typecache.go | ||