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 <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2013-02-13 17:50:32 +01:00 committed by Greg Farnum
parent 4c11a5d135
commit d0896404a9

View 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();