]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
OSDMonitor.h: use !reporters.empty() instead of size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 13:10:21 +0000 (14:10 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 13:10:21 +0000 (14:10 +0100)
commitd7705edfab5375adba49eb8f918fac24d6ec6132
tree3aaa6aec3decf945db4b882d8d13e4165bfc6e3d
parent180cae5e0b586e3ed33e28ddd93f99aab448d0cf
OSDMonitor.h: use !reporters.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().

Using empty() in this case makes the code more logical.

warning from cppcheck was:

[src/mon/OSDMonitor.h:59]: (performance) Possible inefficient
  checking for 'reporters' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/mon/OSDMonitor.h