Replace size() method with empty() when possible.
There is no guaranteed that size() is a constant-time function.
This commit is contained in:
parent
e4c571fc68
commit
d18b34d55f
4 changed files with 5 additions and 6 deletions
|
@ -205,7 +205,7 @@ vector<FilePath> Index::Search(string query) {
|
|||
vector<FilePath> result;
|
||||
FileIdsMap::const_iterator ids_it = file_ids_.begin();
|
||||
for (; ids_it != file_ids_.end(); ++ids_it) {
|
||||
if (trigrams.size() == 0 ||
|
||||
if (trigrams.empty() ||
|
||||
file_ids.find(ids_it->second) != file_ids.end()) {
|
||||
result.push_back(ids_it->first);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue