Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/smt/src/smt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ impl SMT {
return Err(SMTError::InvalidSiblingIndex);
}

let child_nodes: ChildNodes = if path.get(starting_index as usize).is_some() {
let child_nodes: ChildNodes = if path[starting_index as usize] == 1 {
vec![siblings[starting_index as usize].clone(), node.clone()]
} else {
vec![node.clone(), siblings[starting_index as usize].clone()]
Expand All @@ -553,7 +553,7 @@ impl SMT {
/// * `siblings` - The siblings of the path.
fn delete_old_nodes(&mut self, mut node: Node, path: &[usize], siblings: &Siblings) {
for i in (0..siblings.len()).rev() {
let child_nodes: ChildNodes = if path.get(i).is_some() {
let child_nodes: ChildNodes = if path[i] == 1 {
vec![siblings[i].clone(), node.clone()]
} else {
vec![node.clone(), siblings[i].clone()]
Expand Down