Make use of assignment operators
This commit is contained in:
parent
890648df4d
commit
bc9ca20d56
|
@ -34,8 +34,8 @@ fn prepare_tree(vec: &Vec<NodeData>) -> Tree {
|
||||||
loop {
|
loop {
|
||||||
if peak_pos > vec.len() {
|
if peak_pos > vec.len() {
|
||||||
// left child, -2^h
|
// left child, -2^h
|
||||||
peak_pos = peak_pos - (1 << h);
|
peak_pos -= 1 << h;
|
||||||
h = h - 1;
|
h -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if peak_pos <= vec.len() {
|
if peak_pos <= vec.len() {
|
||||||
|
@ -62,7 +62,7 @@ fn prepare_tree(vec: &Vec<NodeData>) -> Tree {
|
||||||
while h > 0 {
|
while h > 0 {
|
||||||
let left_pos = peak_pos - (1 << h);
|
let left_pos = peak_pos - (1 << h);
|
||||||
let right_pos = peak_pos - 1;
|
let right_pos = peak_pos - 1;
|
||||||
h = h - 1;
|
h -= 1;
|
||||||
|
|
||||||
// drafting left child
|
// drafting left child
|
||||||
draft(&mut extra, vec, left_pos, h);
|
draft(&mut extra, vec, left_pos, h);
|
||||||
|
|
|
@ -209,7 +209,7 @@ impl Tree {
|
||||||
|
|
||||||
fn pop(&mut self) {
|
fn pop(&mut self) {
|
||||||
self.stored.remove(&(self.stored_count - 1));
|
self.stored.remove(&(self.stored_count - 1));
|
||||||
self.stored_count = self.stored_count - 1;
|
self.stored_count -= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Truncate one leaf from the end of the tree.
|
/// Truncate one leaf from the end of the tree.
|
||||||
|
|
|
@ -184,7 +184,7 @@ pub fn batch_verify<'a, R: RngCore>(
|
||||||
s.mul_assign(&z);
|
s.mul_assign(&z);
|
||||||
s = s.neg();
|
s = s.neg();
|
||||||
|
|
||||||
r = r * z;
|
r *= z;
|
||||||
|
|
||||||
c.mul_assign(&z);
|
c.mul_assign(&z);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue