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

index 75dcf9e6dba410db9148f42097cd59a617f44b06..095d860c977ab0fbe4836e6569d73aefbf16c37c 100644 (file)
@@ -1834,7 +1834,7 @@ bool MDS::_dispatch(Message *m)
   }
 
   // finish any triggered contexts
-  while (finished_queue.size()) {
+  while (!finished_queue.empty()) {
     dout(7) << "mds has " << finished_queue.size() << " queued contexts" << dendl;
     dout(10) << finished_queue << dendl;
     list<Context*> ls;