Change file_analysis::File::GetID() to return const-ref

This commit is contained in:
Jon Siwek 2020-05-22 00:22:17 -07:00
parent 8a3cd4c65b
commit 27c3c207e4
2 changed files with 2 additions and 2 deletions

View file

@ -74,7 +74,7 @@ public:
/** /**
* @return value of the "id" field from #val record. * @return value of the "id" field from #val record.
*/ */
std::string GetID() const { return id; } const std::string& GetID() const { return id; }
/** /**
* @return value of "last_active" field in #val record; * @return value of "last_active" field in #val record;

View file

@ -396,10 +396,10 @@ bool Manager::RemoveFile(const string& file_id)
DBG_LOG(DBG_FILE_ANALYSIS, "[%s] Remove file", file_id.c_str()); DBG_LOG(DBG_FILE_ANALYSIS, "[%s] Remove file", file_id.c_str());
f->EndOfFile(); f->EndOfFile();
delete f;
id_map.erase(file_id); id_map.erase(file_id);
ignored.erase(file_id); ignored.erase(file_id);
delete f;
return true; return true;
} }