From d428a768e08457c39daaa28a8a0af43e664f2f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 15 Nov 2021 11:17:14 -0800 Subject: [PATCH] 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. --- 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 42b70ba..5e3247f 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 467cd42..c40d229 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); }