Skip to content

Commit

Permalink
tom renamed data member
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Jul 19, 2023
1 parent f6a79c4 commit c5be572
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tom/include/tom/commands/make/support/modelcreator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ namespace Tom::Commands::Make::Support
/*! Forward declarations list for related models. */
std::set<QString> m_forwardsList {};

/*! Cached relations list size to avoid recomputation. */
std::size_t m_relationsListSize = 0;
/*! Cached relations lists size to avoid recomputations (NOT m_relationsList). */
std::size_t m_relationsListsSize = 0;
};

} // namespace Tom::Commands::Make::Support
Expand Down
12 changes: 6 additions & 6 deletions tom/src/tom/commands/make/support/modelcreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ ModelCreator::createPublicSection(const QString &className, const CmdOptions &cm
belongsToManyList);

// Nothing to do, no relations passed
if (m_relationsListSize == 0)
if (m_relationsListsSize == 0)
return {};

RelationsWithOrder publicSectionList;
publicSectionList.reserve(m_relationsListSize);
publicSectionList.reserve(m_relationsListsSize);

publicSectionList |= ranges::actions::push_back(
createOneToOneRelation(className, oneToOneList,
Expand Down Expand Up @@ -881,7 +881,7 @@ QString ModelCreator::createRelationsHash(
] = cmdOptions;

// Nothing to create, no relations passed
if (m_relationsListSize == 0)
if (m_relationsListsSize == 0)
return {};

// Get max. size of relation names for align
Expand All @@ -892,7 +892,7 @@ QString ModelCreator::createRelationsHash(
] = relationsOrder;

RelationsWithOrder relationItemsList;
relationItemsList.reserve(m_relationsListSize); // Use already the cached size value
relationItemsList.reserve(m_relationsListsSize); // Use already the cached size value

relationItemsList |= ranges::actions::push_back(
createOneToOneRelationItem(
Expand Down Expand Up @@ -1283,12 +1283,12 @@ std::size_t ModelCreator::computeReserveForRelationsList(
const QStringList &belongsTo, const QStringList &belongsToMany)
{
// Cache the computed reserve size to avoid recomputation in the private section
m_relationsListSize = static_cast<std::size_t>(oneToOne.size()) +
m_relationsListsSize = static_cast<std::size_t>(oneToOne.size()) +
static_cast<std::size_t>(oneToMany.size()) +
static_cast<std::size_t>(belongsTo.size()) +
static_cast<std::size_t>(belongsToMany.size());

return m_relationsListSize;
return m_relationsListsSize;
}

QString ModelCreator::joinRelationsList(RelationsWithOrder &&relationsList)
Expand Down

0 comments on commit c5be572

Please sign in to comment.