Skip to content

Commit

Permalink
refa remove unused hash_count (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimartiro authored Jan 23, 2024
1 parent 2edd0a1 commit 542829a
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions trie-db/src/triedbmut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,6 @@ impl<'db, L: TrieLayout> TrieDBMutBuilder<'db, L> {
root: self.root,
cache: self.cache,
recorder: self.recorder.map(core::cell::RefCell::new),
hash_count: 0,
storage: NodeStorage::empty(),
death_row: Default::default(),
root_handle,
Expand Down Expand Up @@ -752,9 +751,6 @@ where
root: &'a mut TrieHash<L>,
root_handle: NodeHandle<TrieHash<L>>,
death_row: Set<(TrieHash<L>, (BackingByteVec, Option<u8>))>,
/// The number of hash operations this trie has performed.
/// Note that none are performed until changes are committed.
hash_count: usize,
/// Optional cache for speeding up the lookup of nodes.
cache: Option<&'a mut dyn TrieCache<L::Codec>>,
/// Optional trie recorder for recording trie accesses.
Expand Down Expand Up @@ -1858,7 +1854,6 @@ where
trace!(target: "trie", "encoded root node: {:?}", ToHex(&encoded_root[..]));

*self.root = self.db.insert(EMPTY_PREFIX, &encoded_root);
self.hash_count += 1;

self.cache_node(*self.root, &encoded_root, full_key);

Expand Down Expand Up @@ -2001,7 +1996,6 @@ where
};
if encoded.len() >= L::Hash::LENGTH {
let hash = self.db.insert(prefix.as_prefix(), &encoded);
self.hash_count += 1;

self.cache_node(hash, &encoded, full_key);

Expand Down

0 comments on commit 542829a

Please sign in to comment.