• gary rong's avatar
    trie: polishes to trie committer (#21351) · 053ed9cc
    gary rong authored
    * trie: update tests to check commit integrity
    
    * trie: polish committer
    
    * trie: fix typo
    
    * trie: remove hasvalue notion
    
    According to the benchmarks, type assertion between the pointer and
    interface is extremely fast.
    
    BenchmarkIntmethod-12           1000000000               1.91 ns/op
    BenchmarkInterface-12           1000000000               2.13 ns/op
    BenchmarkTypeSwitch-12          1000000000               1.81 ns/op
    BenchmarkTypeAssertion-12       2000000000               1.78 ns/op
    
    So the overhead for asserting whether the shortnode has "valuenode"
    child is super tiny. No necessary to have another field.
    
    * trie: linter nitpicks
    Co-authored-by: 's avatarMartin Holst Swende <martin@swende.se>
    053ed9cc
Name
Last commit
Last update
..
committer.go Loading commit data...
database.go Loading commit data...
database_test.go Loading commit data...
encoding.go Loading commit data...
encoding_test.go Loading commit data...
errors.go Loading commit data...
hasher.go Loading commit data...
iterator.go Loading commit data...
iterator_test.go Loading commit data...
node.go Loading commit data...
node_test.go Loading commit data...
proof.go Loading commit data...
proof_test.go Loading commit data...
secure_trie.go Loading commit data...
secure_trie_test.go Loading commit data...
stacktrie.go Loading commit data...
stacktrie_test.go Loading commit data...
sync.go Loading commit data...
sync_bloom.go Loading commit data...
sync_test.go Loading commit data...
trie.go Loading commit data...
trie_test.go Loading commit data...