mild borrow_mut cleanup
This commit is contained in:
parent
6ceb02be17
commit
f13e680ee0
@ -42,7 +42,7 @@ where
|
|||||||
}
|
}
|
||||||
let idx;
|
let idx;
|
||||||
{
|
{
|
||||||
idx = self.rand().borrow_mut().below(count) as usize;
|
idx = self.rand_below(count) as usize;
|
||||||
}
|
}
|
||||||
self.mutation_by_idx(idx)
|
self.mutation_by_idx(idx)
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ where
|
|||||||
M: Mutator<I>,
|
M: Mutator<I>,
|
||||||
I: Input + HasBytesVec,
|
I: Input + HasBytesVec,
|
||||||
{
|
{
|
||||||
let bit = mutator.rand().borrow_mut().below(input.bytes().len() as u64) as usize;
|
let bit = mutator.rand_below(input.bytes().len() as u64) as usize;
|
||||||
input.bytes_mut()[bit >> 3] ^= (128 >> (bit & 7)) as u8;
|
input.bytes_mut()[bit >> 3] ^= (128 >> (bit & 7)) as u8;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ where
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn iterations(&mut self) -> usize {
|
fn iterations(&mut self) -> usize {
|
||||||
1 + self.rand().borrow_mut().below(128) as usize
|
1 + self.rand_below(128) as usize
|
||||||
}
|
}
|
||||||
|
|
||||||
fn perform_mutational(&mut self, entry: Rc<RefCell<Testcase<I>>>) -> Result<(), AflError> {
|
fn perform_mutational(&mut self, entry: Rc<RefCell<Testcase<I>>>) -> Result<(), AflError> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user