Optimize FileReferenceManager::merge.

GitOrigin-RevId: a90658d47bacdfd50bf834f54f0b71dd54c375cf
This commit is contained in:
levlam 2019-01-21 20:43:58 +03:00
parent 8ac921b8e7
commit d80e2d5091
1 changed files with 6 additions and 1 deletions

View File

@ -95,8 +95,13 @@ void FileReferenceManager::remove_file_source(NodeId node_id, FileSourceId file_
}
void FileReferenceManager::merge(NodeId to_node_id, NodeId from_node_id) {
auto from_it = nodes_.find(from_node_id);
if (from_it == nodes_.end()) {
return;
}
auto &to = nodes_[to_node_id];
auto &from = nodes_[from_node_id];
auto &from = from_it->second;
VLOG(file_references) << "Merge " << to.file_source_ids.size() << " and " << from.file_source_ids.size()
<< " sources of files " << to_node_id << " and " << from_node_id;
CHECK(!to.query || to.query->proxy.empty());