mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
Improved readability of GetMaxOperandLengthAndValue
This commit is contained in:
parent
c68640ef6e
commit
f92bc38cdb
1 changed files with 6 additions and 4 deletions
|
@ -340,14 +340,16 @@ bool CopyPasteManager::ExpressionRegExMatch(vector<wstring> operands, ViewMode m
|
||||||
|
|
||||||
pair<size_t, uint64_t> CopyPasteManager::GetMaxOperandLengthAndValue(ViewMode mode, CategoryGroupType modeType, int programmerNumberBase, int bitLengthType)
|
pair<size_t, uint64_t> CopyPasteManager::GetMaxOperandLengthAndValue(ViewMode mode, CategoryGroupType modeType, int programmerNumberBase, int bitLengthType)
|
||||||
{
|
{
|
||||||
|
constexpr size_t defaultMaxOperandLength = 0;
|
||||||
|
constexpr uint64_t defaultMaxValue = 0;
|
||||||
|
|
||||||
if (mode == ViewMode::Standard)
|
if (mode == ViewMode::Standard)
|
||||||
{
|
{
|
||||||
return make_pair(MaxStandardOperandLength, 0);
|
return make_pair(MaxStandardOperandLength, defaultMaxValue);
|
||||||
}
|
}
|
||||||
else if (mode == ViewMode::Scientific)
|
else if (mode == ViewMode::Scientific)
|
||||||
{
|
{
|
||||||
return make_pair(MaxScientificOperandLength, 0);
|
return make_pair(MaxScientificOperandLength, defaultMaxValue);
|
||||||
}
|
}
|
||||||
else if (mode == ViewMode::Programmer)
|
else if (mode == ViewMode::Programmer)
|
||||||
{
|
{
|
||||||
|
@ -394,10 +396,10 @@ pair<size_t, uint64_t> CopyPasteManager::GetMaxOperandLengthAndValue(ViewMode mo
|
||||||
}
|
}
|
||||||
else if (modeType == CategoryGroupType::Converter)
|
else if (modeType == CategoryGroupType::Converter)
|
||||||
{
|
{
|
||||||
return make_pair(MaxConverterInputLength, 0);
|
return make_pair(MaxConverterInputLength, defaultMaxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
return make_pair(0, 0);
|
return make_pair(defaultMaxOperandLength, defaultMaxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
wstring CopyPasteManager::SanitizeOperand(const wstring& operand)
|
wstring CopyPasteManager::SanitizeOperand(const wstring& operand)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue