diff --git a/src/game/game_scanner.cpp b/src/game/game_scanner.cpp --- a/src/game/game_scanner.cpp +++ b/src/game/game_scanner.cpp @@ -60,11 +60,10 @@ GameInfo *GameScannerInfo::FindInfo(cons /* See if there is a compatible Game script which goes by that name, with the highest * version which allows loading the requested version */ - ScriptInfoList::iterator it = this->info_list.begin(); - for (; it != this->info_list.end(); it++) { - GameInfo *i = static_cast((*it).second); + for (const auto &item : this->info_list) { + GameInfo *i = static_cast(item.second); if (strcasecmp(game_name, i->GetName()) == 0 && i->CanLoadFromVersion(versionParam) && (version == -1 || i->GetVersion() > version)) { - version = (*it).second->GetVersion(); + version = item.second->GetVersion(); info = i; } } @@ -97,8 +96,8 @@ GameLibrary *GameScannerLibrary::FindLib strtolower(library_name); /* Check if the library + version exists */ - ScriptInfoList::iterator iter = this->info_list.find(library_name); - if (iter == this->info_list.end()) return nullptr; + ScriptInfoList::iterator it = this->info_list.find(library_name); + if (it == this->info_list.end()) return nullptr; - return static_cast((*iter).second); + return static_cast((*it).second); }