]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph_authtool.cc: use empty() instead of size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Tue, 12 Feb 2013 16:20:19 +0000 (17:20 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 15 Feb 2013 20:55:08 +0000 (21:55 +0100)
commitd50a22d6a6466b8dc1c2fbd90a45a8cd295c520d
tree79ce060c5fab1cac5b1629102ec153623b5115be
parentae0c2bbb50ab04467b5223a4f61bfca4b0830142
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>
src/ceph_authtool.cc