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>
if (r < 0)
return r;
string lockstr;
- if (lockers.size()) {
+ if (!lockers.empty()) {
lockstr = (exclusive) ? "excl" : "shr";
}
f->close_section();
}
f->dump_int("format", old_format ? 1 : 2);
- if (lockers.size())
+ if (!lockers.empty())
f->dump_string("lock_type", exclusive ? "exclusive" : "shared");
f->close_section();
} else {
if (f) {
f->close_section();
f->flush(cout);
- } else if (names.size()) {
+ } else if (!names.empty()) {
cout << tbl;
}