perf: avoid cloning prefix sets in TrieWitness::compute (#21352)

This commit is contained in:
katikatidimon
2026-01-27 23:26:31 +01:00
committed by GitHub
parent aa5b12af44
commit 928bf37297

View File

@@ -115,9 +115,10 @@ where
} else {
self.get_proof_targets(&state)?
};
let prefix_sets = core::mem::take(&mut self.prefix_sets);
let multiproof =
Proof::new(self.trie_cursor_factory.clone(), self.hashed_cursor_factory.clone())
.with_prefix_sets_mut(self.prefix_sets.clone())
.with_prefix_sets_mut(prefix_sets)
.multiproof(proof_targets.clone())?;
// No need to reconstruct the rest of the trie, we just need to include