Use empty() since it should be prefered as it has, following the
standard, a constant time complexity regardless of the containter
type. The same is not guaranteed for size().
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
out << " '" << info.standby_for_name << "'";
out << ")";
}
- if (info.export_targets.size())
+ if (!info.export_targets.empty())
out << " export_targets=" << info.export_targets;
out << "\n";
}
out << "e" << get_epoch() << ": " << up.size() << "/" << in.size() << "/" << max_mds << " up";
- if (by_rank.size())
+ if (!by_rank.empty())
out << " " << by_rank;
for (map<string,int>::reverse_iterator p = by_state.rbegin(); p != by_state.rend(); p++)
out << ", " << p->second << " " << p->first;
- if (failed.size())
+ if (!failed.empty())
out << ", " << failed.size() << " failed";
//if (stopped.size())
//out << ", " << stopped.size() << " stopped";
}
}
}
- if (laggy.size()) {
+ if (!laggy.empty()) {
std::ostringstream oss;
oss << "mds " << laggy
<< ((laggy.size() > 1) ? " are":" is")