Use std::vector<std::string> files_removed;

It turns out this field is not used.
This commit is contained in:
Fangrui Song 2018-01-25 22:42:58 -08:00
parent 50c6ed1dd3
commit 1aec53621f
2 changed files with 4 additions and 8 deletions

View File

@ -749,12 +749,6 @@ void QueryDatabase::RemoveUsrs(SymbolKind usr_kind,
// and fully reloads from cache. This will address the memory leak above.
switch (usr_kind) {
case SymbolKind::File: {
// FIXME
// for (const Usr& usr : to_remove)
// files[usr_to_file[usr].id].def = nullopt;
break;
}
case SymbolKind::Type: {
for (const Usr& usr : to_remove)
types[usr_to_type[usr].id].def = nullopt;
@ -770,6 +764,7 @@ void QueryDatabase::RemoveUsrs(SymbolKind usr_kind,
vars[usr_to_var[usr].id].def = nullopt;
break;
}
case SymbolKind::File:
case SymbolKind::Invalid:
break;
}
@ -791,7 +786,8 @@ void QueryDatabase::ApplyIndexUpdate(IndexUpdate* update) {
VerifyUnique(def.def_var_name); \
}
RemoveUsrs(SymbolKind::File, update->files_removed);
for (const std::string& filename : update->files_removed)
files[usr_to_file[filename].id].def = nullopt;
ImportOrUpdate(update->files_def_update);
RemoveUsrs(SymbolKind::Type, update->types_removed);

View File

@ -282,7 +282,7 @@ struct IndexUpdate {
std::string ToString();
// File updates.
std::vector<Usr> files_removed;
std::vector<std::string> files_removed;
std::vector<QueryFile::DefUpdate> files_def_update;
// Type updates.