diff options
author | Neil <nyamatongwe@gmail.com> | 2020-03-23 09:47:51 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2020-03-23 09:47:51 +1100 |
commit | 2646de559b5675f895904de4a211f862642e89c5 (patch) | |
tree | 093ee22b149081406447cc09949caf679708e950 /src/Document.cxx | |
parent | 2c591c0f98f84626611ce25eb3686da45465af46 (diff) | |
download | scintilla-mirror-2646de559b5675f895904de4a211f862642e89c5.tar.gz |
Replace const with constexpr where possible.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index b51d30c0c..d60cef3bb 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -95,7 +95,7 @@ void ActionDuration::AddSample(size_t numberActions, double durationOfActions) n // Alpha value for exponential smoothing. // Most recent value contributes 25% to smoothed value. - const double alpha = 0.25; + constexpr double alpha = 0.25; const double durationOne = durationOfActions / numberActions; duration = std::clamp(alpha * durationOne + (1.0 - alpha) * duration, @@ -2026,7 +2026,7 @@ Sci::Position Document::FindText(Sci::Position minPos, Sci::Position maxPos, con break; } } else if (SC_CP_UTF8 == dbcsCodePage) { - const size_t maxFoldingExpansion = 4; + constexpr size_t maxFoldingExpansion = 4; std::vector<char> searchThing((lengthFind+1) * UTF8MaxBytes * maxFoldingExpansion + 1); const size_t lenSearch = pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind); @@ -2078,8 +2078,8 @@ Sci::Position Document::FindText(Sci::Position minPos, Sci::Position maxPos, con } } } else if (dbcsCodePage) { - const size_t maxBytesCharacter = 2; - const size_t maxFoldingExpansion = 4; + constexpr size_t maxBytesCharacter = 2; + constexpr size_t maxFoldingExpansion = 4; std::vector<char> searchThing((lengthFind+1) * maxBytesCharacter * maxFoldingExpansion + 1); const size_t lenSearch = pcf->Fold(&searchThing[0], searchThing.size(), search, lengthFind); while (forward ? (pos < endPos) : (pos >= endPos)) { |