]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/CDir.cc: use !empty() instead of size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 16:50:32 +0000 (17:50 +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/CDir.cc

index 22cdf48b5af08b6bb630d65d39c73ae90c8f8c00..a1ed05cea263d6c213e7fb951abca5e016245984 100644 (file)
@@ -1175,7 +1175,7 @@ void CDir::add_waiter(uint64_t tag, Context *c)
 /* NOTE: this checks dentry waiters too */
 void CDir::take_waiting(uint64_t mask, list<Context*>& ls)
 {
-  if ((mask & WAIT_DENTRY) && waiting_on_dentry.size()) {
+  if ((mask & WAIT_DENTRY) && !waiting_on_dentry.empty()) {
     // take all dentry waiters
     while (!waiting_on_dentry.empty()) {
       map<string_snap_t, list<Context*> >::iterator p = waiting_on_dentry.begin();