Skip to content

Commit

Permalink
change Vec<u8> to Box<[u8]> for holding a node's hash pre-image (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Laine authored May 23, 2024
1 parent 8f98d73 commit 0c11aed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions firewood/src/hashednode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@ impl HasUpdate for Vec<u8> {
impl<T: ReadLinearStore> HashedNodeStore<T> {
/// Returns the serialized representation of `node` used as the pre-image
/// when hashing the node. The node is at the given `path_prefix`.
pub fn serialize_for_hashing(&self, node: &Node, path_prefix: &Path) -> Vec<u8> {
pub fn serialize_for_hashing(&self, node: &Node, path_prefix: &Path) -> Box<[u8]> {
let mut hasher = vec![];
self.hash_internal_with(node, path_prefix, &mut hasher);
hasher
hasher.into_boxed_slice()
}

// hash a node
Expand Down

0 comments on commit 0c11aed

Please sign in to comment.