mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 09:51:36 +00:00
Per gballet's comment 3101751325 on PR #34055: the *Single functions are essentially the same thing as *ValuesAtStem with one slot set. The original design dispatched through *ValuesAtStem for dedup; this commit restores that shape on the arena side. - GetValue now delegates to GetValuesAtStem and indexes the returned 256-slot array header (no allocation — the stem node returns its own inline values array as a slice). - InsertSingle now builds a stack-allocated [StemNodeWidth][]byte with only the target slot set and delegates to InsertValuesAtStem. - Delete the insertSingleInternal tree walker (~90 LOC) and the whole splitStemInsert (~60 LOC) — the *ValuesAtStem / splitStemValuesInsert pair already handles every case. Addresses gballet comments 3101751325, 3101739001, 3101724199, 3101721238 (the last three subsumed by the consolidation — the duplicated helper bodies no longer exist). Net: ~150 LOC removed from store_ops.go. Allocation cost for InsertSingle is bounded by the stack-allocated 256-slot array (one stack frame, no heap allocation on the hot path). |
||
|---|---|---|
| .. | ||
| binary_node.go | ||
| binary_node_test.go | ||
| hashed_node.go | ||
| hashed_node_test.go | ||
| hasher.go | ||
| internal_node.go | ||
| internal_node_test.go | ||
| iterator.go | ||
| iterator_test.go | ||
| key_encoding.go | ||
| node_ref.go | ||
| node_store.go | ||
| stem_node.go | ||
| stem_node_test.go | ||
| store_commit.go | ||
| store_ops.go | ||
| trie.go | ||
| trie_test.go | ||