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

index f889f25166f4423c5f0bd58e9ff250c63d794320..9c094307e4cc6bbfdbb7ec7b4b12856617c820b7 100644 (file)
@@ -248,7 +248,7 @@ bool OSDMonitor::thrash()
        if (std::find(v.begin(), v.end(), *q) == v.end())
          v.push_back(*q);
     }
-    if (v.size())
+    if (!v.empty())
       pending_inc.new_pg_temp[p->first] = v;
     dout(5) << "thrash_map pg " << p->first << " pg_temp remapped to " << v << dendl;