]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/AsyncReserver.h: use empty() instead of size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 7 Feb 2013 18:55:52 +0000 (19:55 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 11 Feb 2013 10:38:02 +0000 (11:38 +0100)
commit3b77687c42598c721cf98e3f27158bb4f8fa9d10
tree67a9cbdfe85006943f70b2749715366610e5b1ac
parentd427d9828e3adb0b8c967aed9a82ad7dd8864f66
common/AsyncReserver.h: use empty() instead of size()

Fix warning for usage of queue.size() in do_queues(). 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:
[common/AsyncReserver.h:40]: (performance) Possible inefficient
  checking for 'queue' emptiness.

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