diff options
| author | Zufu Liu <unknown> | 2020-05-01 21:34:42 +1000 |
|---|---|---|
| committer | Zufu Liu <unknown> | 2020-05-01 21:34:42 +1000 |
| commit | 6b0a2b81ca2b4054a0598514535780d04b39db5b (patch) | |
| tree | daa573fb697871c167b78b0a7993987a58b58433 | |
| parent | 663d8c816ac74ade4a23f63386f912f729860e9e (diff) | |
| download | scintilla-mirror-6b0a2b81ca2b4054a0598514535780d04b39db5b.tar.gz | |
Backport: Make lambdas noexcept.
Backport of changeset 8222:b11c7c0d7978.
| -rw-r--r-- | lexers/LexCPP.cxx | 2 | ||||
| -rw-r--r-- | src/Decoration.cxx | 8 | ||||
| -rw-r--r-- | src/PerLine.cxx | 4 | ||||
| -rw-r--r-- | src/ViewStyle.cxx | 8 |
4 files changed, 11 insertions, 11 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index 217a1da3f..c7d09a7a3 100644 --- a/lexers/LexCPP.cxx +++ b/lexers/LexCPP.cxx @@ -831,7 +831,7 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i ppDefineHistory.clear(); std::vector<PPDefinition>::iterator itInvalid = std::find_if(ppDefineHistory.begin(), ppDefineHistory.end(), - [lineCurrent](const PPDefinition &p) { return p.line >= lineCurrent; }); + [lineCurrent](const PPDefinition &p) noexcept { return p.line >= lineCurrent; }); if (itInvalid != ppDefineHistory.end()) { ppDefineHistory.erase(itInvalid, ppDefineHistory.end()); definitionsChanged = true; diff --git a/src/Decoration.cxx b/src/Decoration.cxx index 9155a227e..94ec25463 100644 --- a/src/Decoration.cxx +++ b/src/Decoration.cxx @@ -148,7 +148,7 @@ Decoration<POS> *DecorationList<POS>::Create(int indicator, Sci::Position length typename std::vector<std::unique_ptr<Decoration<POS>>>::iterator it = std::lower_bound( decorationList.begin(), decorationList.end(), decoNew, - [](const std::unique_ptr<Decoration<POS>> &a, const std::unique_ptr<Decoration<POS>> &b) { + [](const std::unique_ptr<Decoration<POS>> &a, const std::unique_ptr<Decoration<POS>> &b) noexcept { return a->Indicator() < b->Indicator(); }); typename std::vector<std::unique_ptr<Decoration<POS>>>::iterator itAdded = @@ -162,7 +162,7 @@ Decoration<POS> *DecorationList<POS>::Create(int indicator, Sci::Position length template <typename POS> void DecorationList<POS>::Delete(int indicator) { decorationList.erase(std::remove_if(decorationList.begin(), decorationList.end(), - [indicator](const std::unique_ptr<Decoration<POS>> &deco) { + [indicator](const std::unique_ptr<Decoration<POS>> &deco) noexcept { return deco->Indicator() == indicator; }), decorationList.end()); current = nullptr; @@ -227,7 +227,7 @@ void DecorationList<POS>::DeleteRange(Sci::Position position, Sci::Position dele template <typename POS> void DecorationList<POS>::DeleteLexerDecorations() { decorationList.erase(std::remove_if(decorationList.begin(), decorationList.end(), - [](const std::unique_ptr<Decoration<POS>> &deco) { + [](const std::unique_ptr<Decoration<POS>> &deco) noexcept { return deco->Indicator() < INDICATOR_CONTAINER ; }), decorationList.end()); current = nullptr; @@ -240,7 +240,7 @@ void DecorationList<POS>::DeleteAnyEmpty() { decorationList.clear(); } else { decorationList.erase(std::remove_if(decorationList.begin(), decorationList.end(), - [](const std::unique_ptr<Decoration<POS>> &deco) { + [](const std::unique_ptr<Decoration<POS>> &deco) noexcept { return deco->Empty(); }), decorationList.end()); } diff --git a/src/PerLine.cxx b/src/PerLine.cxx index 085dccbaa..b729386a5 100644 --- a/src/PerLine.cxx +++ b/src/PerLine.cxx @@ -69,12 +69,12 @@ bool MarkerHandleSet::InsertHandle(int handle, int markerNum) { } void MarkerHandleSet::RemoveHandle(int handle) { - mhList.remove_if([handle](const MarkerHandleNumber &mhn) { return mhn.handle == handle; }); + mhList.remove_if([handle](const MarkerHandleNumber &mhn) noexcept { return mhn.handle == handle; }); } bool MarkerHandleSet::RemoveNumber(int markerNum, bool all) { bool performedDeletion = false; - mhList.remove_if([&](const MarkerHandleNumber &mhn) { + mhList.remove_if([&](const MarkerHandleNumber &mhn) noexcept { if ((all || !performedDeletion) && (mhn.number == markerNum)) { performedDeletion = true; return true; diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 43b48544c..8be2bdf6a 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -309,10 +309,10 @@ void ViewStyle::Refresh(Surface &surface, int tabInChars) { } indicatorsDynamic = std::any_of(indicators.cbegin(), indicators.cend(), - [](const Indicator &indicator) { return indicator.IsDynamic(); }); + [](const Indicator &indicator) noexcept { return indicator.IsDynamic(); }); indicatorsSetFore = std::any_of(indicators.cbegin(), indicators.cend(), - [](const Indicator &indicator) { return indicator.OverridesTextFore(); }); + [](const Indicator &indicator) noexcept { return indicator.OverridesTextFore(); }); maxAscent = 1; maxDescent = 1; @@ -327,10 +327,10 @@ void ViewStyle::Refresh(Surface &surface, int tabInChars) { lineOverlap = lineHeight; someStylesProtected = std::any_of(styles.cbegin(), styles.cend(), - [](const Style &style) { return style.IsProtected(); }); + [](const Style &style) noexcept { return style.IsProtected(); }); someStylesForceCase = std::any_of(styles.cbegin(), styles.cend(), - [](const Style &style) { return style.caseForce != Style::caseMixed; }); + [](const Style &style) noexcept { return style.caseForce != Style::caseMixed; }); aveCharWidth = styles[STYLE_DEFAULT].aveCharWidth; spaceWidth = styles[STYLE_DEFAULT].spaceWidth; |
