Codechange: Replace FOR_ALL_TARS with range-based for loops

(cherry picked from commit 34215f7faa)
This commit is contained in:
glx22
2021-04-30 01:13:50 +02:00
committed by Jonathan G Rennison
parent e71798381b
commit ffd30cf91b
4 changed files with 13 additions and 18 deletions

View File

@@ -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 */