diff options
| author | Neil <nyamatongwe@gmail.com> | 2017-04-09 16:55:17 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2017-04-09 16:55:17 +1000 |
| commit | da34a05d99e324ffc3ca802ca9d65db2a4e7eac9 (patch) | |
| tree | c0a586a232d664f3252e697fa98d840993490f3f /src/Catalogue.cxx | |
| parent | 1b763e30f00b6f03d506bf1e1fa0c6cb5264205e (diff) | |
| download | scintilla-mirror-da34a05d99e324ffc3ca802ca9d65db2a4e7eac9.tar.gz | |
Further use of range-for.
Diffstat (limited to 'src/Catalogue.cxx')
| -rw-r--r-- | src/Catalogue.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Catalogue.cxx b/src/Catalogue.cxx index 8dbe1dde0..c4f7a7eda 100644 --- a/src/Catalogue.cxx +++ b/src/Catalogue.cxx @@ -28,10 +28,9 @@ static int nextLanguage = SCLEX_AUTOMATIC+1; const LexerModule *Catalogue::Find(int language) { Scintilla_LinkLexers(); - for (std::vector<LexerModule *>::iterator it=lexerCatalogue.begin(); - it != lexerCatalogue.end(); ++it) { - if ((*it)->GetLanguage() == language) { - return *it; + for (const LexerModule *lm : lexerCatalogue) { + if (lm->GetLanguage() == language) { + return lm; } } return 0; @@ -40,10 +39,9 @@ const LexerModule *Catalogue::Find(int language) { const LexerModule *Catalogue::Find(const char *languageName) { Scintilla_LinkLexers(); if (languageName) { - for (std::vector<LexerModule *>::iterator it=lexerCatalogue.begin(); - it != lexerCatalogue.end(); ++it) { - if ((*it)->languageName && (0 == strcmp((*it)->languageName, languageName))) { - return *it; + for (const LexerModule *lm : lexerCatalogue) { + if (lm->languageName && (0 == strcmp(lm->languageName, languageName))) { + return lm; } } } |
