mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-24 12:02:08 +00:00
Prefer pre-increment/decrement operators in for loops
This commit is contained in:
@@ -160,7 +160,7 @@ std::string Diagnostics<L, W>::processWarningFlag(char const *flag) {
|
||||
}
|
||||
|
||||
// Set the first <param> to enabled/error, and disable the rest
|
||||
for (uint32_t ofs = 0; ofs < maxParam; ofs++) {
|
||||
for (uint32_t ofs = 0; ofs < maxParam; ++ofs) {
|
||||
if (WarningState &warning = state.flagStates[baseID + ofs]; ofs < *param) {
|
||||
warning.update(flagState);
|
||||
} else {
|
||||
|
||||
@@ -112,7 +112,7 @@ struct Palette {
|
||||
// Flipping tends to happen fairly often, so take a bite out of dcache to speed it up
|
||||
static std::array<uint16_t, 256> flipTable = ([]() constexpr {
|
||||
std::array<uint16_t, 256> table{};
|
||||
for (uint16_t i = 0; i < table.size(); i++) {
|
||||
for (uint16_t i = 0; i < table.size(); ++i) {
|
||||
// To flip all the bits, we'll flip both nibbles, then each nibble half, etc.
|
||||
uint16_t byte = i;
|
||||
byte = (byte & 0b0000'1111) << 4 | (byte & 0b1111'0000) >> 4;
|
||||
|
||||
Reference in New Issue
Block a user