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:
parent
cb44d72b78
commit
94ee60041f
9 changed files with 45 additions and 54 deletions
|
|
@ -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 };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue