Cppcheck warnings.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-07-21 17:22:50 +03:00
parent e3b6a788e2
commit ed6e0afd17
2 changed files with 14 additions and 19 deletions

View File

@ -147,6 +147,18 @@ bool NotArrangedDetail(QMap<uint, QMultiMap<qint64, int>> &container, QMap<uint,
} }
return false; return false;
} }
//---------------------------------------------------------------------------------------------------------------------
int TakeFirstForPriority(const QMap<uint, QHash<int, qint64>> &container, uint priority)
{
const QHash<int, qint64> priorityGroup = container.value(priority);
if (not priorityGroup.isEmpty())
{
return priorityGroup.constBegin().key();
}
return -1;
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -541,9 +553,7 @@ void VBank::PrepareDescGroup(uint priority)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
int VBank::GetNextThreeGroups(uint priority) const int VBank::GetNextThreeGroups(uint priority) const
{ {
int next = -1; int next = TakeFirstForPriority(big, priority);
next = TakeFirstForPriority(big, priority);
if (next != -1) if (next != -1)
{ {
return next; return next;
@ -562,9 +572,7 @@ int VBank::GetNextThreeGroups(uint priority) const
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
int VBank::GetNextTwoGroups(uint priority) const int VBank::GetNextTwoGroups(uint priority) const
{ {
int next = -1; int next = TakeFirstForPriority(big, priority);
next = TakeFirstForPriority(big, priority);
if (next != -1) if (next != -1)
{ {
return next; return next;
@ -611,18 +619,6 @@ void VBank::SqMaxMin(qint64 &sMax, qint64 &sMin, uint priority) const
} }
} }
//---------------------------------------------------------------------------------------------------------------------
int VBank::TakeFirstForPriority(const QMap<uint, QHash<int, qint64>> &container, uint priority) const
{
const QHash<int, qint64> priorityGroup = container.value(priority);
if (not priorityGroup.isEmpty())
{
return priorityGroup.constBegin().key();
}
return -1;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
bool VBank::ArrangedDetail(QMap<uint, QHash<int, qint64>> &container, int i) bool VBank::ArrangedDetail(QMap<uint, QHash<int, qint64>> &container, int i)
{ {

View File

@ -115,7 +115,6 @@ private:
int GetNextDescGroup(uint priority) const; int GetNextDescGroup(uint priority) const;
void SqMaxMin(qint64 &sMax, qint64 &sMin, uint priority) const; void SqMaxMin(qint64 &sMax, qint64 &sMin, uint priority) const;
int TakeFirstForPriority(const QMap<uint, QHash<int, qint64>> &container, uint priority) const;
bool ArrangedDetail(QMap<uint, QHash<int, qint64>> &container, int i); bool ArrangedDetail(QMap<uint, QHash<int, qint64>> &container, int i);
bool ArrangedDetail(QMap<uint, QMultiMap<qint64, int>> &container, int i); bool ArrangedDetail(QMap<uint, QMultiMap<qint64, int>> &container, int i);