diff options
author | Henry Wilson <m3henry@googlemail.com> | 2019-02-17 11:20:52 +0000 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2019-03-26 20:15:57 +0000 |
commit | ab711e6942757d775c08c31a6c32d488feba1dba (patch) | |
tree | d102dc6d0e6b9c33e7205b63e3360ebd720a3ebb /src/base_media_base.h | |
parent | 297fd3dda3abe353ebe2fe77c67b011e24d403bc (diff) | |
download | openttd-ab711e6942757d775c08c31a6c32d488feba1dba.tar.xz |
Codechange: Replaced SmallVector::[Begin|End]() with std alternatives
Diffstat (limited to 'src/base_media_base.h')
-rw-r--r-- | src/base_media_base.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/base_media_base.h b/src/base_media_base.h index bcffa11a0..565540155 100644 --- a/src/base_media_base.h +++ b/src/base_media_base.h @@ -76,9 +76,9 @@ struct BaseSet { { free(this->name); - for (TranslatedStrings::iterator iter = this->description.Begin(); iter != this->description.End(); iter++) { - free(iter->first); - free(iter->second); + for (auto &pair : this->description) { + free(pair.first); + free(pair.second); } for (uint i = 0; i < NUM_FILES; i++) { @@ -122,16 +122,16 @@ struct BaseSet { { if (isocode != NULL) { /* First the full ISO code */ - for (TranslatedStrings::const_iterator iter = this->description.Begin(); iter != this->description.End(); iter++) { - if (strcmp(iter->first, isocode) == 0) return iter->second; + for (const auto &pair : this->description) { + if (strcmp(pair.first, isocode) == 0) return pair.second; } /* Then the first two characters */ - for (TranslatedStrings::const_iterator iter = this->description.Begin(); iter != this->description.End(); iter++) { - if (strncmp(iter->first, isocode, 2) == 0) return iter->second; + for (const auto &pair : this->description) { + if (strncmp(pair.first, isocode, 2) == 0) return pair.second; } } /* Then fall back */ - return this->description.Begin()->second; + return this->description.front().second; } /** |