From 6dd91134bd08092d8cc03d9e2ae8cc23efb9b86e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 2 Mar 2026 23:29:00 +0000 Subject: 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 --- util/nvmutil/nvmutil.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index bbbb4e3f..7c0d0c31 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -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; } } -- cgit v1.2.1