sim: Combine a split conditional
Instead of nesting ifs, just use the conditional with an and operator.
@@ -512,14 +512,12 @@ impl Images {
fails += 1;
}
- if self.is_swap_upgrade() {
- if !self.verify_images(&flash, 1, 0) {
+ if self.is_swap_upgrade() && !self.verify_images(&flash, 1, 0) {
warn!("Secondary slot FAIL at step {} of {}",
i, total_flash_ops);
fails += 1;
}
}
- }
if fails > 0 {
error!("{} out of {} failed {:.2}%", fails, total_flash_ops,
