From da34a05d99e324ffc3ca802ca9d65db2a4e7eac9 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 9 Apr 2017 16:55:17 +1000 Subject: Further use of range-for. --- src/Catalogue.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/Catalogue.cxx') 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::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::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; } } } -- cgit v1.2.3