cleaned up potential panic
This commit is contained in:
parent
70be959b82
commit
fb0a23e767
@ -199,15 +199,15 @@ where
|
|||||||
/// Cull the `Corpus` using the `MinimizerCorpusScheduler`
|
/// Cull the `Corpus` using the `MinimizerCorpusScheduler`
|
||||||
#[allow(clippy::unused_self)]
|
#[allow(clippy::unused_self)]
|
||||||
pub fn cull(&self, state: &mut S) -> Result<(), Error> {
|
pub fn cull(&self, state: &mut S) -> Result<(), Error> {
|
||||||
if state.metadata().get::<TopRatedsMetadata>().is_none() {
|
let top_rated = match state.metadata().get::<TopRatedsMetadata>() {
|
||||||
return Ok(());
|
None => return Ok(()),
|
||||||
}
|
Some(val) => val,
|
||||||
let mut acc = HashSet::new();
|
};
|
||||||
let top_rated = state.metadata().get::<TopRatedsMetadata>().unwrap();
|
|
||||||
|
|
||||||
for key in top_rated.map.keys() {
|
let mut acc = HashSet::new();
|
||||||
|
|
||||||
|
for (key, idx) in &top_rated.map {
|
||||||
if !acc.contains(key) {
|
if !acc.contains(key) {
|
||||||
let idx = top_rated.map.get(key).unwrap();
|
|
||||||
let mut entry = state.corpus().get(*idx)?.borrow_mut();
|
let mut entry = state.corpus().get(*idx)?.borrow_mut();
|
||||||
let meta = entry.metadata().get::<M>().ok_or_else(|| {
|
let meta = entry.metadata().get::<M>().ok_or_else(|| {
|
||||||
Error::KeyNotFound(format!(
|
Error::KeyNotFound(format!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user