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().
warning from cppchecker was:
[src/client/SyntheticClient.cc:2706]: (performance) Possible
inefficient checking for 'subdirs' emptiness
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
}
// descend?
- if (.9*roll_die(::pow((double).9,(double)cwd.depth())) && subdirs.size()) {
+ if (.9*roll_die(::pow((double).9,(double)cwd.depth())) && !subdirs.empty()) {
string s = get_random_subdir();
cwd.push_dentry( s );
dout(DBL) << "cd " << s << " -> " << cwd << dendl;