• 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
trie.go 16.8 KB