summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorglx22 <glx@openttd.org>2021-04-30 01:13:50 +0200
committerLoïc Guilloux <glx22@users.noreply.github.com>2021-05-03 19:46:57 +0200
commit34215f7faa2de08d767b4f6945443a8f3175acbf (patch)
treebcef64fe4b46afb04f4d4b6e0379c6386accbda1 /src/script
parent7bcc472f73c774163285f71c235852ba0911e88e (diff)
downloadopenttd-34215f7faa2de08d767b4f6945443a8f3175acbf.tar.xz
Codechange: Replace FOR_ALL_TARS with range-based for loops
Diffstat (limited to 'src/script')
-rw-r--r--src/script/script_scanner.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/script/script_scanner.cpp b/src/script/script_scanner.cpp
index 8b48809bf..bdde99f6c 100644
--- a/src/script/script_scanner.cpp
+++ b/src/script/script_scanner.cpp
@@ -224,16 +224,15 @@ static bool IsSameScript(const ContentInfo *ci, bool md5sum, ScriptInfo *info, S
if (!tar_filename.empty() && (iter = _tar_list[dir].find(tar_filename)) != _tar_list[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 MD5 checksumming. */
- TarFileList::iterator tar;
- FOR_ALL_TARS(tar, dir) {
+ for (const auto &tar : _tar_filelist[dir]) {
/* Not in the same tar. */
- if (tar->second.tar_filename != iter->first) continue;
+ if (tar.second.tar_filename != iter->first) continue;
/* Check the extension. */
- const char *ext = strrchr(tar->first.c_str(), '.');
+ const char *ext = strrchr(tar.first.c_str(), '.');
if (ext == nullptr || strcasecmp(ext, ".nut") != 0) continue;
- checksum.AddFile(tar->first, 0, tar_filename);
+ checksum.AddFile(tar.first, 0, tar_filename);
}
} else {
char path[MAX_PATH];