trie: remove dead code (#20405)

This commit is contained in:
gary rong 2019-11-28 18:47:35 +08:00 committed by Igor Mandrigin
parent 572f341baf
commit 14bb7db725

View File

@ -18,6 +18,8 @@ package trie
import (
"encoding/binary"
"errors"
"fmt"
"io"
"reflect"
"sync"
@ -201,19 +203,6 @@ func expandNode(hash hashNode, n node, cachegen uint16) node {
return nil
}
// 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.