]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/Locker.cc: use !empty() instead of size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 16:56:12 +0000 (17:56 +0100)
committerGreg Farnum <greg@inktank.com>
Thu, 14 Feb 2013 18:27:39 +0000 (10:27 -0800)
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/mds/Locker.cc

index d2ba41a4d76f5c123939e01fba8057d82eb7fc21..da6661889ef0dd680b9b8406a25064e3baf55782 100644 (file)
@@ -1575,7 +1575,7 @@ void Locker::file_update_finish(CInode *in, Mutation *mut, bool share, client_t
   mut->cleanup();
   delete mut;
 
-  if (!in->is_head() && in->client_snap_caps.size()) {
+  if (!in->is_head() && !in->client_snap_caps.empty()) {
     dout(10) << " client_snap_caps " << in->client_snap_caps << dendl;
     // check for snap writeback completion
     bool gather = false;
@@ -2357,7 +2357,7 @@ void Locker::handle_client_caps(MClientCaps *m)
     //  We can infer that the client WONT send a FLUSHSNAP once they have
     //  released all WR/EXCL caps (the FLUSHSNAP always comes before the cap
     //  update/release).
-    if (head_in->client_need_snapflush.size()) {
+    if (!head_in->client_need_snapflush.empty()) {
       if ((cap->issued() & CEPH_CAP_ANY_FILE_WR) == 0) {
        _do_null_snapflush(head_in, client, follows);
       } else {