diff options
author | Neil <nyamatongwe@gmail.com> | 2018-06-04 14:43:24 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-06-04 14:43:24 +1000 |
commit | 41d0d56e0b8b6d7b4e1fd5a6229bb846c34775ab (patch) | |
tree | df89aa7a3bcc35f477041e069dbc76186e5f8228 | |
parent | 7e9f3208e5c6eb5036cbdfc0f85245f0aa97ab7c (diff) | |
download | scintilla-mirror-41d0d56e0b8b6d7b4e1fd5a6229bb846c34775ab.tar.gz |
Use lambda in preference to function object.
-rw-r--r-- | lexers/LexCPP.cxx | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx index af9463a7e..1210eb412 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; |