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 cppcheck was:
[src/mds/journal.cc:470]: (performance) Possible inefficient
checking for 'old_inodes' emptiness.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
return snaprealm || // other snaprealms will link to me
inode.is_dir() || // links to me in other snaps
inode.nlink > 1 || // there are remote links, possibly snapped, that will need to find me
- old_inodes.size(); // once multiversion, always multiversion. until old_inodes gets cleaned out.
+ !old_inodes.empty(); // once multiversion, always multiversion. until old_inodes gets cleaned out.
}
snapid_t get_oldest_snap();