From 39bd629a40836403a66bc9d2b70a8e4a1219e02a Mon Sep 17 00:00:00 2001 From: Nicholas Baron Date: Tue, 16 Apr 2019 23:23:57 -0700 Subject: [PATCH] StandardScientificOperandLength now uses a const wstring& --- src/CalcViewModel/Common/CopyPasteManager.cpp | 4 ++-- src/CalcViewModel/Common/CopyPasteManager.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CalcViewModel/Common/CopyPasteManager.cpp b/src/CalcViewModel/Common/CopyPasteManager.cpp index ad9ee362..36658cdc 100644 --- a/src/CalcViewModel/Common/CopyPasteManager.cpp +++ b/src/CalcViewModel/Common/CopyPasteManager.cpp @@ -477,9 +477,9 @@ size_t CopyPasteManager::OperandLength(wstring operand, ViewMode mode, CategoryG } } -size_t CopyPasteManager::StandardScientificOperandLength(wstring operand) +size_t CopyPasteManager::StandardScientificOperandLength(const wstring& operand) { - const bool hasDecimal = operand.find('.') != std::wstring::npos; + const bool hasDecimal = operand.find('.') != wstring::npos; if (hasDecimal) { diff --git a/src/CalcViewModel/Common/CopyPasteManager.h b/src/CalcViewModel/Common/CopyPasteManager.h index bc00e37c..79dd73d9 100644 --- a/src/CalcViewModel/Common/CopyPasteManager.h +++ b/src/CalcViewModel/Common/CopyPasteManager.h @@ -56,7 +56,7 @@ namespace CalculatorApp static std::wstring SanitizeOperand(const std::wstring& operand); static bool TryOperandToULL(const std::wstring& operand, int numberBase, unsigned long long int& result); static size_t OperandLength(std::wstring operand, CalculatorApp::Common::ViewMode mode, CalculatorApp::Common::CategoryGroupType modeType, int programmerNumberBase = -1); - static size_t StandardScientificOperandLength(std::wstring operand); + static size_t StandardScientificOperandLength(const std::wstring& operand); static size_t ProgrammerOperandLength(const std::wstring& operand, int numberBase); static std::wstring RemoveUnwantedCharsFromWstring(const std::wstring& input);