summaryrefslogtreecommitdiff
path: root/src/newgrf_text.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-02-17 11:20:52 +0000
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commitab711e6942757d775c08c31a6c32d488feba1dba (patch)
treed102dc6d0e6b9c33e7205b63e3360ebd720a3ebb /src/newgrf_text.cpp
parent297fd3dda3abe353ebe2fe77c67b011e24d403bc (diff)
downloadopenttd-ab711e6942757d775c08c31a6c32d488feba1dba.tar.xz
Codechange: Replaced SmallVector::[Begin|End]() with std alternatives
Diffstat (limited to 'src/newgrf_text.cpp')
-rw-r--r--src/newgrf_text.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/newgrf_text.cpp b/src/newgrf_text.cpp
index b92b84355..57f2ce5e4 100644
--- a/src/newgrf_text.cpp
+++ b/src/newgrf_text.cpp
@@ -168,8 +168,8 @@ static byte _currentLangID = GRFLX_ENGLISH; ///< by default, english is used.
int LanguageMap::GetMapping(int newgrf_id, bool gender) const
{
const SmallVector<Mapping, 1> &map = gender ? this->gender_map : this->case_map;
- for (const Mapping *m = map.Begin(); m != map.End(); m++) {
- if (m->newgrf_id == newgrf_id) return m->openttd_id;
+ for (const Mapping &m : map) {
+ if (m.newgrf_id == newgrf_id) return m.openttd_id;
}
return -1;
}
@@ -183,8 +183,8 @@ int LanguageMap::GetMapping(int newgrf_id, bool gender) const
int LanguageMap::GetReverseMapping(int openttd_id, bool gender) const
{
const SmallVector<Mapping, 1> &map = gender ? this->gender_map : this->case_map;
- for (const Mapping *m = map.Begin(); m != map.End(); m++) {
- if (m->openttd_id == openttd_id) return m->newgrf_id;
+ for (const Mapping &m : map) {
+ if (m.openttd_id == openttd_id) return m.newgrf_id;
}
return -1;
}
@@ -194,8 +194,8 @@ struct UnmappedChoiceList : ZeroedMemoryAllocator {
/** Clean everything up. */
~UnmappedChoiceList()
{
- for (SmallPair<byte, char *> *p = this->strings.Begin(); p < this->strings.End(); p++) {
- free(p->second);
+ for (SmallPair<byte, char *> p : this->strings) {
+ free(p.second);
}
}