data: use uint32_t instead of Id in SqliteIndexStorage local indexes

This commit is contained in:
Eberhard Graether
2018-10-20 04:13:13 +02:00
parent 426e16c75b
commit 4638ea2baf
2 changed files with 10 additions and 10 deletions
@@ -245,7 +245,7 @@ std::vector<Id> SqliteIndexStorage::addEdges(const std::vector<StorageEdge>& edg
for (size_t i = 0; i < edges.size(); i++)
{
const StorageEdge& data = edges[i];
std::map<StorageEdgeData, Id>::const_iterator it = m_tempEdgeIndex.find(data);
std::map<StorageEdgeData, uint32_t>::const_iterator it = m_tempEdgeIndex.find(data);
if (it != m_tempEdgeIndex.end())
{
edgeIds[i] = it->second;
@@ -348,7 +348,7 @@ std::vector<Id> SqliteIndexStorage::addSourceLocations(const std::vector<Storage
{
for (const StorageSourceLocation& loc : getAll<StorageSourceLocation>())
{
std::map<TempSourceLocation, Id>& index = m_tempSourceLocationIndices[loc.fileNodeId];
std::map<TempSourceLocation, uint32_t>& index = m_tempSourceLocationIndices[loc.fileNodeId];
index.emplace(
TempSourceLocation(loc.startLine, loc.endLine - loc.startLine, loc.startCol, loc.endCol, loc.type),
loc.id);
@@ -364,8 +364,8 @@ std::vector<Id> SqliteIndexStorage::addSourceLocations(const std::vector<Storage
const StorageSourceLocation& data = locations[i];
const TempSourceLocation tempLoc(data.startLine, data.endLine - data.startLine, data.startCol, data.endCol, data.type);
std::map<TempSourceLocation, Id>& index = m_tempSourceLocationIndices[data.fileNodeId];
std::map<TempSourceLocation, Id>::const_iterator it = index.find(tempLoc);
std::map<TempSourceLocation, uint32_t>& index = m_tempSourceLocationIndices[data.fileNodeId];
std::map<TempSourceLocation, uint32_t>::const_iterator it = index.find(tempLoc);
if (it != index.end())
{
locationIds[i] = it->second;
@@ -217,12 +217,12 @@ private:
return ResultType();
}
LowMemoryStringMap<std::string, Id, 0> m_tempNodeNameIndex;
LowMemoryStringMap<std::wstring, Id, 0> m_tempWNodeNameIndex;
std::map<Id, int> m_tempNodeTypes;
std::map<StorageEdgeData, Id> m_tempEdgeIndex;
std::map<std::wstring, std::map<std::pair<uint32_t, uint32_t>, Id>> m_tempLocalSymbolIndex;
std::map<Id, std::map<TempSourceLocation, Id>> m_tempSourceLocationIndices;
LowMemoryStringMap<std::string, uint32_t, 0> m_tempNodeNameIndex;
LowMemoryStringMap<std::wstring, uint32_t, 0> m_tempWNodeNameIndex;
std::map<uint32_t, int> m_tempNodeTypes;
std::map<StorageEdgeData, uint32_t> m_tempEdgeIndex;
std::map<std::wstring, std::map<std::pair<uint32_t, uint32_t>, uint32_t>> m_tempLocalSymbolIndex;
std::map<uint32_t, std::map<TempSourceLocation, uint32_t>> m_tempSourceLocationIndices;
template <typename StorageType>
class InsertBatchStatement