Remove unneeded loop in SpliceMutator::mutate
(#1471)
previously we searched for the first and the last difference between exactly the same 2 inputs 3 times in a loop Co-authored-by: Andrea Fioraldi <andreafioraldi@gmail.com>
This commit is contained in:
parent
7d2c854b71
commit
f3a4f4f664
@ -1282,18 +1282,13 @@ where
|
||||
let mut other_testcase = state.corpus().get(idx)?.borrow_mut();
|
||||
let other = other_testcase.load_input(state.corpus())?;
|
||||
|
||||
let mut counter: u32 = 0;
|
||||
loop {
|
||||
let (f, l) = locate_diffs(input.bytes(), other.bytes());
|
||||
|
||||
if f != l && f >= 0 && l >= 2 {
|
||||
break (f as u64, l as u64);
|
||||
}
|
||||
if counter == 3 {
|
||||
(f as u64, l as u64)
|
||||
} else {
|
||||
return Ok(MutationResult::Skipped);
|
||||
}
|
||||
counter += 1;
|
||||
}
|
||||
};
|
||||
|
||||
let split_at = state.rand_mut().between(first_diff, last_diff) as usize;
|
||||
|
Loading…
x
Reference in New Issue
Block a user