Skip to content

Commit

Permalink
Merge pull request #59 from mavotronik/rewrite
Browse files Browse the repository at this point in the history
Delete unnecessary comments
  • Loading branch information
YeahNotSewerSide authored May 4, 2024
2 parents 39b4fc0 + 982b6ed commit df6d865
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/merkletree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl MerkleTree {
}

for left_index in (1..nodes_total - 1).step_by(2).rev() {
//let mut hasher = Sha256::new();

let mut to_hash = [0u8; 32];
unsafe {
for (index, (left, right)) in array_representation
Expand All @@ -57,8 +57,7 @@ impl MerkleTree {
{
*to_hash.get_unchecked_mut(index) = *left & *right;
}
//hasher.reset();


let hash = Sha256::digest(to_hash);

*(array_representation.get_unchecked_mut((left_index - 1) / 2)) =
Expand Down Expand Up @@ -96,7 +95,7 @@ impl MerkleTree {
let lsb_set = index & 1;
let lsb_not_set = lsb_set ^ 1;

// let mut sibling_index = index;


index += lsb_set;
index -= lsb_not_set;
Expand Down Expand Up @@ -152,13 +151,7 @@ impl MerkleTree {
unsafe { self.array_representation.get_unchecked(0) }
}

// pub fn new() -> MerkleTree {
// todo!()
// }

// pub fn add_objects(&mut self, input: &Vec<[u8; 32]>) -> bool {
// todo!()
// }

}

#[cfg(test)]
Expand Down

0 comments on commit df6d865

Please sign in to comment.