mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-15 17:58:46 +02:00
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:
@@ -464,9 +464,9 @@ swap(int partnum)
|
|||||||
|
|
||||||
for (size_t w = NVM_SIZE * ((uint8_t *) &e)[0], x = 1;
|
for (size_t w = NVM_SIZE * ((uint8_t *) &e)[0], x = 1;
|
||||||
w < NVM_SIZE; w += 2, x += 2) {
|
w < NVM_SIZE; w += 2, x += 2) {
|
||||||
|
uint8_t chg = n[w];
|
||||||
n[w] ^= n[x];
|
n[w] ^= n[x];
|
||||||
n[x] ^= n[w];
|
n[x] ^= chg;
|
||||||
n[w] ^= n[x];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user