1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Enumerate: Replace some non-ranged loops

This commit is contained in:
reuk 2023-09-21 14:34:52 +01:00
parent cb44d72b78
commit 94ee60041f
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
9 changed files with 45 additions and 54 deletions

View file

@ -55,10 +55,8 @@ struct Factory
std::array<uint32_t, 2> words;
size_t index = 0;
for (auto& word : words)
word = ByteOrder::bigEndianInt (bytes.data() + 4 * index++);
for (const auto [index, word] : enumerate (words))
word = ByteOrder::bigEndianInt (bytes.data() + 4 * index);
return PacketX2 { words };
}
@ -79,10 +77,8 @@ struct Factory
std::array<uint32_t, 4> words;
size_t index = 0;
for (auto& word : words)
word = ByteOrder::bigEndianInt (bytes.data() + 4 * index++);
for (const auto [index, word] : enumerate (words))
word = ByteOrder::bigEndianInt (bytes.data() + 4 * index);
return PacketX4 { words };
}