Description of the changes:

Remove redundancy
Simplify if statements
This commit is contained in:
Shamkhal Maharramov 2019-03-21 01:28:30 +04:00 коммит произвёл Howard Wolosky
Родитель 683b91aeec
Коммит 251ffffc50
2 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -34,15 +34,13 @@ unsigned int CalculatorHistory::AddToHistory(_In_ shared_ptr<CalculatorVector <p
unsigned int CalculatorHistory::AddItem(_In_ shared_ptr<HISTORYITEM> const &spHistoryItem)
{
int lastIndex;
if (m_historyItems.size() >= m_maxHistorySize)
{
m_historyItems.erase(m_historyItems.begin());
}
m_historyItems.push_back(spHistoryItem);
lastIndex = static_cast<unsigned>(m_historyItems.size() - 1);
unsigned int lastIndex = static_cast<unsigned>(m_historyItems.size() - 1);
return lastIndex;
}

Просмотреть файл

@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
@ -360,7 +360,7 @@ namespace CalculationManager
/// <param name = "serializedPrimaryDisplay">Serialized Rational of primary display</param>
void CalculatorManager::DeSerializePrimaryDisplay(const vector<long> &serializedPrimaryDisplay)
{
if (serializedPrimaryDisplay.size() == 0)
if (serializedPrimaryDisplay.empty())
{
return;
}