Skip to content

Commit

Permalink
fixed Clang Tidy warnings for Qt v5
Browse files Browse the repository at this point in the history
After #pragma system_header fixed.
  • Loading branch information
silverqx committed May 3, 2024
1 parent e341396 commit 7a47c6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions include/orm/tiny/types/syncchanges.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ namespace Types
SyncChanges::size_type SyncChanges::size() const
noexcept(std::is_nothrow_invocable_v<decltype (&mapped_type::size), ContainerType &>)
{
return static_cast<size_type>(attached().size() +
detached().size() +
updated().size());
return static_cast<size_type>(attached().size()) +
static_cast<size_type>(detached().size()) +
static_cast<size_type>(updated().size());
}

bool SyncChanges::empty() const
Expand Down
9 changes: 6 additions & 3 deletions tom/include/tom/commands/make/support/modelcreator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<decltype (m_relationsListsSize)>(
oneToOne.size() + oneToMany.size() +
belongsTo.size() + belongsToMany.size());
return m_relationsListsSize = static_cast<SizeType>(oneToOne.size()) +
static_cast<SizeType>(oneToMany.size()) +
static_cast<SizeType>(belongsTo.size()) +
static_cast<SizeType>(belongsToMany.size());
}

} // namespace Tom::Commands::Make::Support
Expand Down

0 comments on commit 7a47c6c

Please sign in to comment.