util/nvmutil: don't use xor swap

it doesn't save any time on modern systems, and it's just
confusing for some people to read. i mean, i understand it
instinctively, but normal people do it with a swap variable.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-02 23:29:00 +00:00
parent 53e386d2b5
commit 6dd91134bd

View File

@@ -464,9 +464,9 @@ swap(int partnum)
for (size_t w = NVM_SIZE * ((uint8_t *) &e)[0], x = 1;
w < NVM_SIZE; w += 2, x += 2) {
uint8_t chg = n[w];
n[w] ^= n[x];
n[x] ^= n[w];
n[w] ^= n[x];
n[x] ^= chg;
}
}