mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 07:37:20 +00:00
I removed `Iterator.Count` in #33840, because it appeared to be unused and did not provide the documented invariant: the returned count should always be an upper bound on the number of iterations allowed by `Next`. In order to make `Count` work, the semantics of `CountValues` has to change to return the number of items up and including the invalid one. I have reviewed all callsites of `CountValues` to assess if changing this is safe. There aren't that many, and the only call that doesn't check the error and return is in the trie node parser, `trie.decodeNodeUnsafe`. There, we distinguish the node type based on the number of items, and it previously returned an error for item count zero. In order to avoid any potential issue that could result from this change, I'm adding an error check in that function, though it isn't necessary. |
||
|---|---|---|
| .. | ||
| 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 | ||