use std.mem.swap

This commit is contained in:
Folkert 2021-06-09 14:19:14 +02:00
parent d2ff1d735d
commit 12c186813d
2 changed files with 3 additions and 9 deletions

View file

@ -542,9 +542,7 @@ pub fn listWalk(
const element = source_ptr + i * element_width;
caller(data, element, b2, b1);
const temp = b1;
b2 = b1;
b1 = temp;
std.mem.swap([*]u8, &b1, &b2);
}
}
@ -591,9 +589,7 @@ pub fn listWalkBackwards(
const element = source_ptr + i * element_width;
caller(data, element, b2, b1);
const temp = b1;
b2 = b1;
b1 = temp;
std.mem.swap([*]u8, &b1, &b2);
}
}