data: avoid duplicate access components
* added check to make sure that an access component does not already exist before inserting it into the database
This commit is contained in:
@@ -121,7 +121,10 @@ void PersistentStorage::addSourceLocation(
|
||||
|
||||
void PersistentStorage::addComponentAccess(Id nodeId , int type)
|
||||
{
|
||||
m_sqliteStorage.addComponentAccess(nodeId, type);
|
||||
if (m_sqliteStorage.getComponentAccessByNodeId(nodeId).nodeId == 0)
|
||||
{
|
||||
m_sqliteStorage.addComponentAccess(nodeId, type);
|
||||
}
|
||||
}
|
||||
|
||||
void PersistentStorage::addCommentLocation(Id fileNodeId, uint startLine, uint startCol, uint endLine, uint endCol)
|
||||
|
||||
@@ -440,7 +440,7 @@ void Node::addComponentAccess(std::shared_ptr<TokenComponentAccess> component)
|
||||
{
|
||||
if (getComponent<TokenComponentAccess>())
|
||||
{
|
||||
LOG_ERROR("TokenComponentAccess has been set before!");
|
||||
LOG_WARNING("TokenComponentAccess has been set before!");
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user