aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-06-04 14:43:24 +1000
committerNeil <nyamatongwe@gmail.com>2018-06-04 14:43:24 +1000
commit6d504647c4974d8cf1968126af64e3f1a1b26ba0 (patch)
tree269a85c9d56162d03cd8d124cbdee61e58facbfb
parentd3accd58aeb1ae49ef3ca9003fadbcd3daafb93e (diff)
downloadscintilla-mirror-6d504647c4974d8cf1968126af64e3f1a1b26ba0.tar.gz
Backport: Use lambda in preference to function object.
Backport of changeset 7019:6023ccf7f06c.
-rw-r--r--lexers/LexCPP.cxx12
1 files changed, 2 insertions, 10 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index eaf4900fe..f0fc01f7b 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -719,15 +719,6 @@ Sci_Position SCI_METHOD LexerCPP::WordListSet(int n, const char *wl) {
return firstModification;
}
-// Functor used to truncate history
-struct After {
- Sci_Position line;
- explicit After(Sci_Position line_) : line(line_) {}
- bool operator()(const PPDefinition &p) const {
- return p.line > line;
- }
-};
-
void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
LexAccessor styler(pAccess);
@@ -788,7 +779,8 @@ void SCI_METHOD LexerCPP::Lex(Sci_PositionU startPos, Sci_Position length, int i
if (!options.updatePreprocessor)
ppDefineHistory.clear();
- std::vector<PPDefinition>::iterator itInvalid = std::find_if(ppDefineHistory.begin(), ppDefineHistory.end(), After(lineCurrent-1));
+ std::vector<PPDefinition>::iterator itInvalid = std::find_if(ppDefineHistory.begin(), ppDefineHistory.end(),
+ [lineCurrent](const PPDefinition &p) { return p.line >= lineCurrent; });
if (itInvalid != ppDefineHistory.end()) {
ppDefineHistory.erase(itInvalid, ppDefineHistory.end());
definitionsChanged = true;