simplify sample collection
This commit is contained in:
@@ -725,10 +725,8 @@ impl VM {
|
|||||||
let samples = self
|
let samples = self
|
||||||
.batch_device(source, prefab, None)
|
.batch_device(source, prefab, None)
|
||||||
.map(|device| device.borrow_mut().get_field(typ))
|
.map(|device| device.borrow_mut().get_field(typ))
|
||||||
.collect::<Result<Vec<_>, ICError>>()?
|
.filter_ok(|val| !val.is_nan())
|
||||||
.into_iter()
|
.collect::<Result<Vec<_>, ICError>>()?;
|
||||||
.filter(|val| !val.is_nan())
|
|
||||||
.collect_vec();
|
|
||||||
Ok(mode.apply(&samples))
|
Ok(mode.apply(&samples))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -743,10 +741,8 @@ impl VM {
|
|||||||
let samples = self
|
let samples = self
|
||||||
.batch_device(source, prefab, Some(name))
|
.batch_device(source, prefab, Some(name))
|
||||||
.map(|device| device.borrow_mut().get_field(typ))
|
.map(|device| device.borrow_mut().get_field(typ))
|
||||||
.collect::<Result<Vec<_>, ICError>>()?
|
.filter_ok(|val| !val.is_nan())
|
||||||
.into_iter()
|
.collect::<Result<Vec<_>, ICError>>()?;
|
||||||
.filter(|val| !val.is_nan())
|
|
||||||
.collect_vec();
|
|
||||||
Ok(mode.apply(&samples))
|
Ok(mode.apply(&samples))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -762,10 +758,8 @@ impl VM {
|
|||||||
let samples = self
|
let samples = self
|
||||||
.batch_device(source, prefab, Some(name))
|
.batch_device(source, prefab, Some(name))
|
||||||
.map(|device| device.borrow().get_slot_field(index, typ))
|
.map(|device| device.borrow().get_slot_field(index, typ))
|
||||||
.collect::<Result<Vec<_>, ICError>>()?
|
.filter_ok(|val| !val.is_nan())
|
||||||
.into_iter()
|
.collect::<Result<Vec<_>, ICError>>()?;
|
||||||
.filter(|val| !val.is_nan())
|
|
||||||
.collect_vec();
|
|
||||||
Ok(mode.apply(&samples))
|
Ok(mode.apply(&samples))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -780,10 +774,8 @@ impl VM {
|
|||||||
let samples = self
|
let samples = self
|
||||||
.batch_device(source, prefab, None)
|
.batch_device(source, prefab, None)
|
||||||
.map(|device| device.borrow().get_slot_field(index, typ))
|
.map(|device| device.borrow().get_slot_field(index, typ))
|
||||||
.collect::<Result<Vec<_>, ICError>>()?
|
.filter_ok(|val| !val.is_nan())
|
||||||
.into_iter()
|
.collect::<Result<Vec<_>, ICError>>()?;
|
||||||
.filter(|val| !val.is_nan())
|
|
||||||
.collect_vec();
|
|
||||||
Ok(mode.apply(&samples))
|
Ok(mode.apply(&samples))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user