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/cls/lock/cls_lock.cc:209]: (performance) Possible inefficient
checking for 'lockers' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
}
}
- if (lockers.size()) {
+ if (!lockers.empty()) {
if (exclusive) {
CLS_LOG(20, "could not exclusive-lock object, already locked");
return -EBUSY;