Skip to content

Commit c8a0728

Browse files
committed
f - local variable for left and right leaves
1 parent 950ae96 commit c8a0728

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lightning/src/offers/merkle.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ fn root_hash(data: &[u8]) -> sha256::Hash {
4848
break;
4949
}
5050

51-
for (i, j) in (0..num_leaves).step_by(step).zip((offset..num_leaves).step_by(step)) {
51+
let left_leaves = (0..num_leaves).step_by(step);
52+
let right_leaves = (offset..num_leaves).step_by(step);
53+
for (i, j) in left_leaves.zip(right_leaves) {
5254
leaves[i] = tagged_branch_hash_from_engine(branch_tag.clone(), leaves[i], leaves[j]);
5355
}
5456
}

0 commit comments

Comments
 (0)