Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MksmOrlov committed Jun 19, 2024
1 parent 1611fed commit 4280a36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ ScAddrUnorderedSet ScComponentManagerCommandInit::Execute(ScMemoryContext * cont
while (repositoriesIterator->Next())
{
repository = repositoriesIterator->Get(2);
ScAddrUnorderedSet specificationsTemp = ProcessRepository(context, repository);

specifications.insert(specificationsTemp.cbegin(), specificationsTemp.cend());
ProcessRepository(context, repository, specifications);
}

return specifications;
Expand All @@ -36,17 +34,16 @@ ScAddrUnorderedSet ScComponentManagerCommandInit::Execute(ScMemoryContext * cont
* @param context current sc-memory context
* @param repository ScAddr of a repository of components to load
*/
ScAddrUnorderedSet ScComponentManagerCommandInit::ProcessRepository(ScMemoryContext * context, ScAddr & repository)
void ScComponentManagerCommandInit::ProcessRepository(ScMemoryContext * context, ScAddr & repository, ScAddrUnorderedSet & specifications)
{
ScAddrUnorderedSet specifications;
ScAddr const & specificationsSetAddr = utils::IteratorUtils::getAnyByOutRelation(
context, repository, keynodes::ScComponentManagerKeynodes::rrel_components_specifications);
if (!context->IsElement(specificationsSetAddr))
{
SC_LOG_WARNING(
"ScComponentManagerCommandInit: components specification not found in repository "
<< context->HelperGetSystemIdtf(repository));
return specifications;
return;
}

ScAddr componentSpecification;
Expand All @@ -72,6 +69,4 @@ ScAddrUnorderedSet ScComponentManagerCommandInit::ProcessRepository(ScMemoryCont
SC_LOG_DEBUG(
"ScComponentManagerCommandInit: loaded specification " << context->HelperGetSystemIdtf(componentSpecification));
}

return specifications;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ScComponentManagerCommandInit : public ScComponentManagerCommand

ScAddrUnorderedSet Execute(ScMemoryContext * context, ScAddr const & actionAddr) override;

ScAddrUnorderedSet ProcessRepository(ScMemoryContext * context, ScAddr & repositories);
void ProcessRepository(ScMemoryContext * context, ScAddr & repositories, ScAddrUnorderedSet & specifications);

protected:
std::string m_specificationsPath;
Expand Down

0 comments on commit 4280a36

Please sign in to comment.