From 3ed962be8c916f68a70c976edd92dcdc265db33a Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 17:56:12 +0100 Subject: [PATCH] mds/Locker.cc: use !empty() instead of size() 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 --- src/mds/Locker.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index d2ba41a4d76f..da6661889ef0 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -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 { -- 2.47.3