From aa2ae6a26954283b120d0b985ecb03e79d91083d Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 17:59:09 +0100 Subject: [PATCH] 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 --- src/mds/MDS.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mds/MDS.cc b/src/mds/MDS.cc index 75dcf9e6dba41..095d860c977ab 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; -- 2.39.5