Avoid no-op in ByteRandMutator (#999)

This commit is contained in:
van Hauser 2023-01-17 11:07:50 +01:00 committed by GitHub
parent 7cf7d545a6
commit 15c1c0fb5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,7 +311,7 @@ where
Ok(MutationResult::Skipped) Ok(MutationResult::Skipped)
} else { } else {
let byte = state.rand_mut().choose(input.bytes_mut()); let byte = state.rand_mut().choose(input.bytes_mut());
*byte = state.rand_mut().next() as u8; *byte ^= 1 + state.rand_mut().below(254) as u8;
Ok(MutationResult::Mutated) Ok(MutationResult::Mutated)
} }
} }