From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 13:42:47 +0000 (+0100) Subject: PGMonitor.cc: use !empty() instead of size() to check for emptiness X-Git-Tag: v0.58~66^2~52 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0b3123429307d81a514586436999186dcda27ba9;p=ceph.git 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 --- diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index f34ffb8a704..213aac44bae 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()));