Drop non-negative tests on unsigned values (#1729)

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-11-15 11:17:14 -08:00 committed by GitHub
parent 441bf39c0b
commit d428a768e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}