diff options
author | glx22 <glx@openttd.org> | 2021-04-30 01:13:50 +0200 |
---|---|---|
committer | Loïc Guilloux <glx22@users.noreply.github.com> | 2021-05-03 19:46:57 +0200 |
commit | 34215f7faa2de08d767b4f6945443a8f3175acbf (patch) | |
tree | bcef64fe4b46afb04f4d4b6e0379c6386accbda1 /src/game | |
parent | 7bcc472f73c774163285f71c235852ba0911e88e (diff) | |
download | openttd-34215f7faa2de08d767b4f6945443a8f3175acbf.tar.xz |
Codechange: Replace FOR_ALL_TARS with range-based for loops
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/game_text.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/game/game_text.cpp b/src/game/game_text.cpp index 24f41c93a..ce20c1ee7 100644 --- a/src/game/game_text.cpp +++ b/src/game/game_text.cpp @@ -249,16 +249,15 @@ GameStrings *LoadTranslations() if (!tar_filename.empty() && (iter = _tar_list[GAME_DIR].find(tar_filename)) != _tar_list[GAME_DIR].end()) { /* The main script is in a tar file, so find all files that * are in the same tar and add them to the langfile scanner. */ - TarFileList::iterator tar; - FOR_ALL_TARS(tar, GAME_DIR) { + for (const auto &tar : _tar_filelist[GAME_DIR]) { /* Not in the same tar. */ - if (tar->second.tar_filename != iter->first) continue; + if (tar.second.tar_filename != iter->first) continue; /* Check the path and extension. */ - if (tar->first.size() <= ldir.size() || tar->first.compare(0, ldir.size(), ldir) != 0) continue; - if (tar->first.compare(tar->first.size() - 4, 4, ".txt") != 0) continue; + if (tar.first.size() <= ldir.size() || tar.first.compare(0, ldir.size(), ldir) != 0) continue; + if (tar.first.compare(tar.first.size() - 4, 4, ".txt") != 0) continue; - scanner.AddFile(tar->first, 0, tar_filename); + scanner.AddFile(tar.first, 0, tar_filename); } } else { /* Scan filesystem */ |