]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PGMonitor.cc: use !empty() instead of size() to check for emptiness
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 13:42:47 +0000 (14:42 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 13:42:47 +0000 (14:42 +0100)
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>
src/mon/PGMonitor.cc

index f34ffb8a70425f33e95996c4efccaa9aea58f933..213aac44bae070b579e417aee4626176838098a3 100644 (file)
@@ -1345,7 +1345,7 @@ void PGMonitor::check_full_osd_health(list<pair<health_status_t,string> >& summa
                                      const set<int>& 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()));