From 0b3123429307d81a514586436999186dcda27ba9 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 14:42:47 +0100 Subject: [PATCH] PGMonitor.cc: use !empty() instead of size() to check for emptiness 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 --- src/mon/PGMonitor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index f34ffb8a70425..213aac44bae07 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -1345,7 +1345,7 @@ void PGMonitor::check_full_osd_health(list >& summa const set& s, const char *desc, health_status_t sev) const { - if (s.size() > 0) { + if (!s.empty()) { ostringstream ss; ss << s.size() << " " << desc << " osd(s)"; summary.push_back(make_pair(sev, ss.str())); -- 2.39.5