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().
Using empty() in this case makes the code more logical.
warning from cppcheck was:
[src/mon/OSDMonitor.h:59]: (performance) Possible inefficient
checking for 'reporters' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
failure_info_t() : num_reports(0) {}
utime_t get_failed_since() {
- if (max_failed_since == utime_t() && reporters.size()) {
+ if (max_failed_since == utime_t() && !reporters.empty()) {
// the old max must have canceled; recalculate.
for (map<int, failure_reporter_t>::iterator p = reporters.begin();
p != reporters.end();