mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
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:
parent
4c11a5d135
commit
d0896404a9
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user