From d0896404a9a5acd5430aff62d4684dc5ccb00ea6 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 13 Feb 2013 17:50:32 +0100 Subject: [PATCH] mds/CDir.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/CDir.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index 22cdf48b5af..a1ed05cea26 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -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& 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 >::iterator p = waiting_on_dentry.begin(); -- 2.47.3