diff options
author | Neil <nyamatongwe@gmail.com> | 2018-06-04 14:46:14 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-06-04 14:46:14 +1000 |
commit | 0fd5c7e24ad9589daa37c948649ea6da0a949703 (patch) | |
tree | f1bd9d1e625297c045cd81dee7e48aa50e0b323e /src | |
parent | c1cbc18b7c39346de6ea942324e97c36990d8528 (diff) | |
download | scintilla-mirror-0fd5c7e24ad9589daa37c948649ea6da0a949703.tar.gz |
Backport: Reduce scope of captures for lambdas.
Use noexcept.
Backport of changeset 7021:764284d21a03.
Diffstat (limited to 'src')
-rw-r--r-- | src/Decoration.cxx | 6 | ||||
-rw-r--r-- | src/PerLine.cxx | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/Decoration.cxx b/src/Decoration.cxx index 1295e9779..104f75ae2 100644 --- a/src/Decoration.cxx +++ b/src/Decoration.cxx @@ -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(), - [=](const std::unique_ptr<Decoration<POS>> &deco) { + [indicator](const std::unique_ptr<Decoration<POS>> &deco) { 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) { return deco->Indicator() < INDIC_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) { return deco->Empty(); }), decorationList.end()); } diff --git a/src/PerLine.cxx b/src/PerLine.cxx index 8240f4829..4ac4de9ce 100644 --- a/src/PerLine.cxx +++ b/src/PerLine.cxx @@ -60,7 +60,7 @@ bool MarkerHandleSet::InsertHandle(int handle, int markerNum) { } void MarkerHandleSet::RemoveHandle(int handle) { - mhList.remove_if([=](const MarkerHandleNumber &mhn) { return mhn.handle == handle; }); + mhList.remove_if([handle](const MarkerHandleNumber &mhn) { return mhn.handle == handle; }); } bool MarkerHandleSet::RemoveNumber(int markerNum, bool all) { @@ -284,7 +284,7 @@ Sci::Line LineState::GetMaxLineState() const { return static_cast<Sci::Line>(lineStates.Length()); } -static int NumberLines(const char *text) { +static int NumberLines(const char *text) noexcept { if (text) { int newLines = 0; while (*text) { |