mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 14:13:30 -07:00
Prevented unneeded copies from being made.
Removed an unneeded catch
This commit is contained in:
parent
b8e5e22d11
commit
b6b4f41f53
1 changed files with 4 additions and 11 deletions
|
@ -20,7 +20,7 @@ String^ CopyPasteManager::supportedFormats[] =
|
|||
StandardDataFormats::Text
|
||||
};
|
||||
|
||||
constexpr wstring_view c_validCharacterSet{ L"0123456789()+-*/.abcdefABCDEF" };
|
||||
static constexpr wstring_view c_validCharacterSet{ L"0123456789()+-*/.abcdefABCDEF" };
|
||||
|
||||
// The below values can not be "constexpr"-ed,
|
||||
// as both wstring_view and wchar[] can not be concatenated
|
||||
|
@ -269,10 +269,7 @@ bool CopyPasteManager::ExpressionRegExMatch(vector<wstring> operands, ViewMode m
|
|||
bool expMatched = true;
|
||||
vector<wregex> patterns{};
|
||||
|
||||
// Could this be auto?
|
||||
pair<size_t, uint64_t> operandLimits = GetMaxOperandLengthAndValue(mode, modeType, programmerNumberBase, bitLengthType);
|
||||
size_t maxOperandLength = operandLimits.first;
|
||||
uint64_t maxOperandValue = operandLimits.second;
|
||||
const auto [maxOperandLength, maxOperandValue] = GetMaxOperandLengthAndValue(mode, modeType, programmerNumberBase, bitLengthType);
|
||||
|
||||
if (mode == ViewMode::Standard)
|
||||
{
|
||||
|
@ -442,15 +439,11 @@ bool CopyPasteManager::TryOperandToULL(const wstring& operand, int numberBase, u
|
|||
result = stoull(operand, &size, intBase);
|
||||
return true;
|
||||
}
|
||||
catch (invalid_argument)
|
||||
catch (const invalid_argument&)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
catch (out_of_range)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
catch(...)
|
||||
catch (const out_of_range&)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue