diff --git a/include/orm/tiny/types/syncchanges.hpp b/include/orm/tiny/types/syncchanges.hpp index 8c639a07a..650c22195 100644 --- a/include/orm/tiny/types/syncchanges.hpp +++ b/include/orm/tiny/types/syncchanges.hpp @@ -335,9 +335,9 @@ namespace Types SyncChanges::size_type SyncChanges::size() const noexcept(std::is_nothrow_invocable_v) { - return static_cast(attached().size() + - detached().size() + - updated().size()); + return static_cast(attached().size()) + + static_cast(detached().size()) + + static_cast(updated().size()); } bool SyncChanges::empty() const diff --git a/tom/include/tom/commands/make/support/modelcreator.hpp b/tom/include/tom/commands/make/support/modelcreator.hpp index 75c17318a..bdb9688a2 100644 --- a/tom/include/tom/commands/make/support/modelcreator.hpp +++ b/tom/include/tom/commands/make/support/modelcreator.hpp @@ -232,10 +232,13 @@ namespace Tom::Commands::Make::Support const QStringList &oneToOne, const QStringList &oneToMany, const QStringList &belongsTo, const QStringList &belongsToMany) { + using SizeType = decltype (m_relationsListsSize); + // Cache the computed reserve size to avoid recomputation in the private section - return m_relationsListsSize = static_cast( - oneToOne.size() + oneToMany.size() + - belongsTo.size() + belongsToMany.size()); + return m_relationsListsSize = static_cast(oneToOne.size()) + + static_cast(oneToMany.size()) + + static_cast(belongsTo.size()) + + static_cast(belongsToMany.size()); } } // namespace Tom::Commands::Make::Support