Codechange: Use std::vector for GRFConfig lists. (#10835)

This replaces the C-style custom managed linked-list and allows use of iterators etc.
This commit is contained in:
Peter Nelson
2025-01-31 17:09:09 +00:00
committed by GitHub
parent 40aeedeade
commit 5664b1e2f6
23 changed files with 248 additions and 384 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ static void WriteSavegameInfo(const std::string &name)
message += "NewGRFs:\n";
if (_load_check_data.HasNewGrfs()) {
for (GRFConfig *c = _load_check_data.grfconfig; c != nullptr; c = c->next) {
for (const auto &c : _load_check_data.grfconfig) {
fmt::format_to(std::back_inserter(message), "{:08X} {} {}\n", std::byteswap(c->ident.grfid),
FormatArrayAsHex(HasBit(c->flags, GCF_COMPATIBLE) ? c->original_md5sum : c->ident.md5sum), c->filename);
}