From 8bfa55f63b86927049d16e24b4b729baa5d58c1c Mon Sep 17 00:00:00 2001 From: gary rong Date: Thu, 28 Nov 2019 18:47:35 +0800 Subject: [PATCH] trie: remove dead code (#20405) --- trie/database.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/trie/database.go b/trie/database.go index d510a6588508..931918efb5d7 100644 --- a/trie/database.go +++ b/trie/database.go @@ -17,7 +17,6 @@ package trie import ( - "encoding/binary" "errors" "fmt" "io" @@ -272,19 +271,6 @@ func expandNode(hash hashNode, n node) node { } } -// trienodeHasher is a struct to be used with BigCache, which uses a Hasher to -// determine which shard to place an entry into. It's not a cryptographic hash, -// just to provide a bit of anti-collision (default is FNV64a). -// -// Since trie keys are already hashes, we can just use the key directly to -// map shard id. -type trienodeHasher struct{} - -// Sum64 implements the bigcache.Hasher interface. -func (t trienodeHasher) Sum64(key string) uint64 { - return binary.BigEndian.Uint64([]byte(key)) -} - // NewDatabase creates a new trie database to store ephemeral trie content before // its written out to disk or garbage collected. No read cache is created, so all // data retrievals will hit the underlying disk database.