Remove redundant breaks

They do not need to be there since return works here.
This commit is contained in:
Rose 2022-09-30 09:01:58 -04:00
commit fd3c771f45

View file

@ -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);