src/osd/PG.h: use empty() instead of size()

Fix warning for usage of objects.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/PG.h:599]: (performance) Possible inefficient checking for
  'objects' emptiness.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2013-02-07 20:16:46 +01:00
parent 76798eabea
commit 1f0fd50490

View File

@ -596,7 +596,7 @@ protected:
/// Adjusts begin to the first object
void trim() {
if (objects.size())
if (!objects.empty())
begin = objects.begin()->first;
else
begin = end;