mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
Avoid recomputing loop termination condition
LLVM might take care of this for us, but just to be safe!
This commit is contained in:
parent
f9f708b362
commit
8666a2ad58
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue