mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
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:
parent
76798eabea
commit
1f0fd50490
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user