summaryrefslogtreecommitdiff
path: root/src/ceph_authtool.cc
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-02-12 17:20:19 +0100
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2013-02-15 21:55:08 +0100
commitd50a22d6a6466b8dc1c2fbd90a45a8cd295c520d (patch)
tree79ce060c5fab1cac5b1629102ec153623b5115be /src/ceph_authtool.cc
parentae0c2bbb50ab04467b5223a4f61bfca4b0830142 (diff)
downloadceph-d50a22d6a6466b8dc1c2fbd90a45a8cd295c520d.tar.gz
ceph_authtool.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(). 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>
Diffstat (limited to 'src/ceph_authtool.cc')
-rw-r--r--src/ceph_authtool.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ceph_authtool.cc b/src/ceph_authtool.cc
index d4d205a4fa1..3075d9c69a7 100644
--- a/src/ceph_authtool.cc
+++ b/src/ceph_authtool.cc
@@ -121,7 +121,7 @@ int main(int argc, const char **argv)
!add_key.empty() ||
list ||
!caps_fn.empty() ||
- caps.size() ||
+ !caps.empty() ||
set_auid ||
print_key ||
create_keyring ||
@@ -234,7 +234,7 @@ int main(int argc, const char **argv)
keyring.set_caps(ename, caps);
modified = true;
}
- if (caps.size()) {
+ if (!caps.empty()) {
keyring.set_caps(ename, caps);
modified = true;
}