Drop non-negative tests on unsigned values

As some of the variables are of unsigned types, it makes no sense to
test them for non-negativeness, as this is enforced by type already.
This commit is contained in:
Michał Janiszewski 2021-10-19 23:52:13 +02:00
commit 39bc32fb3f
2 changed files with 2 additions and 2 deletions

View file

@ -600,7 +600,7 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
// Set the "(=xx" indicator.
if (nullptr != m_pCalcDisplay)
{
m_pCalcDisplay->SetParenthesisNumber(m_openParenCount >= 0 ? static_cast<unsigned int>(m_openParenCount) : 0);
m_pCalcDisplay->SetParenthesisNumber(static_cast<unsigned int>(m_openParenCount));
}
if (!m_bError)

View file

@ -79,7 +79,7 @@ vector<shared_ptr<HISTORYITEM>> const& CalculatorHistory::GetHistory()
shared_ptr<HISTORYITEM> const& CalculatorHistory::GetHistoryItem(unsigned int uIdx)
{
assert(uIdx >= 0 && uIdx < m_historyItems.size());
assert(uIdx < m_historyItems.size());
return m_historyItems.at(uIdx);
}