From 06665dafdea42d34abf6aefa19e85c9dc5851f85 Mon Sep 17 00:00:00 2001 From: Maharramoff Date: Mon, 11 Mar 2019 00:50:13 +0400 Subject: [PATCH] refactor: redundant local variable --- src/CalcManager/CalculatorHistory.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/CalcManager/CalculatorHistory.cpp b/src/CalcManager/CalculatorHistory.cpp index a34ca272..1c1f7b0d 100644 --- a/src/CalcManager/CalculatorHistory.cpp +++ b/src/CalcManager/CalculatorHistory.cpp @@ -35,16 +35,13 @@ unsigned int CalculatorHistory::AddToHistory(_In_ shared_ptr const &spHistoryItem) { - int lastIndex; - if (m_historyItems.size() >= m_maxHistorySize) { m_historyItems.erase(m_historyItems.begin()); } m_historyItems.push_back(spHistoryItem); - lastIndex = static_cast(m_historyItems.size() - 1); - return lastIndex; + return static_cast(m_historyItems.size() - 1); } bool CalculatorHistory::RemoveItem(_In_ unsigned int uIdx)