From 39bc32fb3fc6ef8bc9a9f2839ddc771ff78c6a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 19 Oct 2021 23:52:13 +0200 Subject: [PATCH] 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. --- src/CalcManager/CEngine/scicomm.cpp | 2 +- src/CalcManager/CalculatorHistory.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CalcManager/CEngine/scicomm.cpp b/src/CalcManager/CEngine/scicomm.cpp index 42b70ba2..5e3247f9 100644 --- a/src/CalcManager/CEngine/scicomm.cpp +++ b/src/CalcManager/CEngine/scicomm.cpp @@ -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(m_openParenCount) : 0); + m_pCalcDisplay->SetParenthesisNumber(static_cast(m_openParenCount)); } if (!m_bError) diff --git a/src/CalcManager/CalculatorHistory.cpp b/src/CalcManager/CalculatorHistory.cpp index 467cd420..c40d2299 100644 --- a/src/CalcManager/CalculatorHistory.cpp +++ b/src/CalcManager/CalculatorHistory.cpp @@ -79,7 +79,7 @@ vector> const& CalculatorHistory::GetHistory() shared_ptr const& CalculatorHistory::GetHistoryItem(unsigned int uIdx) { - assert(uIdx >= 0 && uIdx < m_historyItems.size()); + assert(uIdx < m_historyItems.size()); return m_historyItems.at(uIdx); }