]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
src/osd/OSD.h: use empty() instead of size()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 7 Feb 2013 19:14:34 +0000 (20:14 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Mon, 11 Feb 2013 10:38:02 +0000 (11:38 +0100)
commit76798eabea4d166ef8abd943b78769656a081531
tree6e0450b99114cf4bbca76a5ca67359d4a6ca2c5e
parent99f217503af033445ca2c39b0619836860fe4608
src/osd/OSD.h: use empty() instead of size()

Fix warning for usage 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:
[osd/OSD.h:265]: (performance) Possible inefficient checking for
   'last_scrub_pg' emptiness.
[osd/OSD.h:274]: (performance) Possible inefficient checking for
   'last_scrub_pg' emptiness.

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