Skip to content

Commit b8b7117

Browse files
committed
db/version_set.cc: use !empty() instead of 'size() > 0'
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(). Fix for: [db/version_set.cc:2250]: (performance) Possible inefficient checking for 'column_families_not_found' emptiness. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
1 parent 8ce050b commit b8b7117

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

db/version_set.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -2169,7 +2169,7 @@ Status VersionSet::Recover(
21692169

21702170
// there were some column families in the MANIFEST that weren't specified
21712171
// in the argument. This is OK in read_only mode
2172-
if (read_only == false && column_families_not_found.size() > 0) {
2172+
if (read_only == false && !column_families_not_found.empty()) {
21732173
std::string list_of_not_found;
21742174
for (const auto& cf : column_families_not_found) {
21752175
list_of_not_found += ", " + cf.second;

0 commit comments

Comments
 (0)