From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 16:59:09 +0000 (+0100) Subject: mds/MDS.cc: use !empty() instead of size() to check for emptiness X-Git-Tag: v0.58~66^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aa2ae6a26954283b120d0b985ecb03e79d91083d;p=ceph.git mds/MDS.cc: use !empty() instead of size() to check for emptiness 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 --- diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 75dcf9e6dba4..095d860c977a 100644 --- a/src/mds/MDS.cc +++ b/src/mds/MDS.cc @@ -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 ls;