HomeSource World

trie: polishes to trie committer (#21351)

Description

trie: polishes to trie committer (#21351)

  • 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: Martin Holst Swende <martin@swende.se>

Details

Provenance
gary rong <garyrong0905@gmail.com>Authored on Sep 30 2020, 11:45 AM
GitHub <noreply@github.com>Committed on Sep 30 2020, 11:45 AM
Parents
rGETHdad26582b6ec: accounts, signer: implement gnosis safe support (#21593)
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rGETH053ed9cc8476: trie: polishes to trie committer (#21351) (authored by gary rong <garyrong0905@gmail.com>).Sep 30 2020, 11:45 AM