]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common/WorkQueue.h: use empty() instead of size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 7 Feb 2013 19:04:39 +0000 (20:04 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 11 Feb 2013 10:38:02 +0000 (11:38 +0100)
commit698670726ad0a8c64b84c893b0a46cbf8b3442df
treedb91dc4aebe4d520d4421a1f850f1bbcfe267d17
parent3b77687c42598c721cf98e3f27158bb4f8fa9d10
common/WorkQueue.h: use empty() instead of size()

Fix warning for usage of out->size() in _void_dequeue(). 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/WorkQueue.h:97]: (performance) Possible inefficient
  checking for 'queue' emptiness.

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