]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: use !empty() instead of size() > 0
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 19 Feb 2014 16:55:17 +0000 (17:55 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 19 Feb 2014 16:55:17 +0000 (17:55 +0100)
[src/mon/OSDMonitor.cc:730]: (performance) Possible inefficient checking
  for 'osd_weight' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mon/OSDMonitor.cc

index b25c4248babd39b496ea852a06d56dd89bcf460c..d3bd7af1a474199ac8a32c3a962b181910e7fa34 100644 (file)
@@ -727,7 +727,7 @@ bool OSDMonitor::should_propose(double& delay)
     return true;
 
   // adjust osd weights?
-  if (osd_weight.size() > 0 &&
+  if (!osd_weight.empty() &&
       osd_weight.size() == (unsigned)osdmap.get_max_osd()) {
     dout(0) << " adjusting osd weights based on " << osd_weight << dendl;
     osdmap.adjust_osd_weights(osd_weight, pending_inc);