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/ceph_authtool.cc:124]: (performance) Possible inefficient
checking for 'caps' emptiness.
[src/ceph_authtool.cc:237]: (performance) Possible inefficient
checking for 'caps' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
!add_key.empty() ||
list ||
!caps_fn.empty() ||
- caps.size() ||
+ !caps.empty() ||
set_auid ||
print_key ||
create_keyring ||
keyring.set_caps(ename, caps);
modified = true;
}
- if (caps.size()) {
+ if (!caps.empty()) {
keyring.set_caps(ename, caps);
modified = true;
}