mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-24 15:05:19 -07:00
Remove redundant breaks
They do not need to be there since return works here.
This commit is contained in:
parent
9deb19682d
commit
fd3c771f45
1 changed files with 1 additions and 9 deletions
|
@ -17,24 +17,16 @@ std::shared_ptr<IExpressionCommand> CommandDeserializer::Deserialize(_In_ Calcul
|
||||||
switch (cmdType)
|
switch (cmdType)
|
||||||
{
|
{
|
||||||
case CalculationManager::CommandType::OperandCommand:
|
case CalculationManager::CommandType::OperandCommand:
|
||||||
|
|
||||||
return std::make_shared<COpndCommand>(DeserializeOperand());
|
return std::make_shared<COpndCommand>(DeserializeOperand());
|
||||||
break;
|
|
||||||
|
|
||||||
case CalculationManager::CommandType::Parentheses:
|
case CalculationManager::CommandType::Parentheses:
|
||||||
|
|
||||||
return std::make_shared<CParentheses>(DeserializeParentheses());
|
return std::make_shared<CParentheses>(DeserializeParentheses());
|
||||||
break;
|
|
||||||
|
|
||||||
case CalculationManager::CommandType::UnaryCommand:
|
case CalculationManager::CommandType::UnaryCommand:
|
||||||
|
|
||||||
return std::make_shared<CUnaryCommand>(DeserializeUnary());
|
return std::make_shared<CUnaryCommand>(DeserializeUnary());
|
||||||
break;
|
|
||||||
|
|
||||||
case CalculationManager::CommandType::BinaryCommand:
|
case CalculationManager::CommandType::BinaryCommand:
|
||||||
|
|
||||||
return std::make_shared<CBinaryCommand>(DeserializeBinary());
|
return std::make_shared<CBinaryCommand>(DeserializeBinary());
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw ref new Platform::Exception(E_INVALIDARG, ref new Platform::String(L"Unknown command type"));
|
throw ref new Platform::Exception(E_INVALIDARG, ref new Platform::String(L"Unknown command type"));
|
||||||
|
@ -50,7 +42,7 @@ COpndCommand CommandDeserializer::DeserializeOperand()
|
||||||
std::shared_ptr<std::vector<int>> cmdVector = std::make_shared<std::vector<int>>();
|
std::shared_ptr<std::vector<int>> cmdVector = std::make_shared<std::vector<int>>();
|
||||||
auto cmdVectorSize = m_dataReader->ReadUInt32();
|
auto cmdVectorSize = m_dataReader->ReadUInt32();
|
||||||
|
|
||||||
for (unsigned int j = 0; j < cmdVectorSize; ++j)
|
for (auto j = cmdVectorSize; j > 0; --j)
|
||||||
{
|
{
|
||||||
int eachOpndcmd = m_dataReader->ReadInt32();
|
int eachOpndcmd = m_dataReader->ReadInt32();
|
||||||
cmdVector->push_back(eachOpndcmd);
|
cmdVector->push_back(eachOpndcmd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue