logic: Fixed slow aggregation click and nodes not staying expanded

This commit is contained in:
Eberhard Graether
2016-05-21 04:44:31 +02:00
parent 5d2a476813
commit badad741b0
10 changed files with 92 additions and 93 deletions
-36
View File
@@ -797,42 +797,6 @@ Id PersistentStorage::getTokenIdForFileNode(const FilePath& filePath) const
return m_sqliteStorage.getFileByPath(filePath.str()).id;
}
std::vector<Id> PersistentStorage::getTokenIdsForAggregationEdge(Id sourceId, Id targetId) const
{
std::vector<Id> edgeIds;
std::vector<Id> aggregationEndpointsA = getAllChildNodeIds(sourceId);
std::set<Id> aggregationEndpointsB;
aggregationEndpointsB.insert(targetId);
for (const Id targetChildId: getAllChildNodeIds(targetId))
{
aggregationEndpointsB.insert(targetChildId);
}
for (size_t i = 0; i < aggregationEndpointsA.size(); i++)
{
std::vector<StorageEdge> outgoingEdges = m_sqliteStorage.getEdgesBySourceId(aggregationEndpointsA[i]);
for (size_t j = 0; j < outgoingEdges.size(); j++)
{
if (aggregationEndpointsB.find(outgoingEdges[j].targetNodeId) != aggregationEndpointsB.end())
{
edgeIds.push_back(outgoingEdges[j].id);
}
}
std::vector<StorageEdge> incomingEdges = m_sqliteStorage.getEdgesByTargetId(aggregationEndpointsA[i]);
for (size_t j = 0; j < incomingEdges.size(); j++)
{
if (aggregationEndpointsB.find(incomingEdges[j].sourceNodeId) != aggregationEndpointsB.end())
{
edgeIds.push_back(incomingEdges[j].id);
}
}
}
return edgeIds;
}
std::shared_ptr<TokenLocationCollection> PersistentStorage::getTokenLocationsForTokenIds(const std::vector<Id>& tokenIds) const
{
std::shared_ptr<TokenLocationCollection> collection = std::make_shared<TokenLocationCollection>();