bool OSDMonitor::check_failures(utime_t now)
{
bool found_failure = false;
- for (map<int,failure_info_t>::iterator p = failure_info.begin();
- p != failure_info.end();
- ++p) {
- if (can_mark_down(p->first)) {
- found_failure |= check_failure(now, p->first, p->second);
+ auto p = failure_info.begin();
+ while (p != failure_info.end()) {
+ auto& [target_osd, fi] = *p;
+ if (can_mark_down(target_osd)) {
+ found_failure |= check_failure(now, target_osd, fi);
}
+ ++p;
}
return found_failure;
}