Codechange: range based for loops instead of C-style for loops

This commit is contained in:
Rubidium
2024-04-09 17:18:35 +02:00
committed by rubidium42
parent 2587a21400
commit 4f2412a272
19 changed files with 65 additions and 66 deletions

View File

@@ -24,8 +24,8 @@ static uint8_t GetGRFContainerVersion(SpriteFile &file)
if (file.ReadWord() == 0) {
/* Check for GRF container version 2, which is identified by the bytes
* '47 52 46 82 0D 0A 1A 0A' at the start of the file. */
for (uint i = 0; i < lengthof(_grf_cont_v2_sig); i++) {
if (file.ReadByte() != _grf_cont_v2_sig[i]) return 0; // Invalid format
for (const auto &expected_sig_byte : _grf_cont_v2_sig) {
if (file.ReadByte() != expected_sig_byte) return 0; // Invalid format
}
return 2;