Avoid recomputing loop termination condition

LLVM might take care of this for us, but just to be safe!
This commit is contained in:
Richard Feldman 2021-05-22 14:48:40 -04:00
parent f9f708b362
commit 8666a2ad58

View file

@ -677,7 +677,9 @@ pub fn listDrop(
const keep_count = size - drop_count;
var i: usize = 0;
while (i < std.math.min(drop_count, size)) : (i += 1) {
const iterations = std.math.min(drop_count, size);
while (i < iterations) : (i += 1) {
const element = source_ptr + i * element_width;
dec(element);
}